chore: code cleanup

This commit is contained in:
Swarsel 2024-07-20 00:10:56 +02:00
parent e66e4978ff
commit 23cfb96adb
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
8 changed files with 3701 additions and 3681 deletions

File diff suppressed because it is too large Load diff

112
flake.lock generated
View file

@ -237,24 +237,6 @@
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github" "type": "github"
}, },
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": { "original": {
"id": "flake-parts", "id": "flake-parts",
"type": "indirect" "type": "indirect"
@ -535,25 +517,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-gaming": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1720920199,
"narHash": "sha256-0dNwRhtUVQha5S+NFeoeMXEt/6v0x56DCdyUk+vEFeY=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "fce565402d5b1ed4e92c4a9dfcd094d0172d8f0b",
"type": "github"
},
"original": {
"owner": "fufexan",
"repo": "nix-gaming",
"type": "github"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
@ -620,7 +583,7 @@
"nixgl": { "nixgl": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1713543440, "lastModified": 1713543440,
@ -732,18 +695,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1720954236, "lastModified": 1720954236,
@ -825,22 +776,6 @@
} }
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": {
"lastModified": 1720781449,
"narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8b5a3d5a1d951344d683b442c0739010b80039db",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1660551188, "lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
@ -855,6 +790,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": {
"locked": {
"lastModified": 1720957393,
"narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1720957393, "lastModified": 1720957393,
@ -872,22 +823,6 @@
} }
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": {
"lastModified": 1720957393,
"narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1720781449, "lastModified": 1720781449,
"narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=", "narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=",
@ -903,7 +838,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_8": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1714912032, "lastModified": 1714912032,
"narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=", "narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=",
@ -969,8 +904,8 @@
}, },
"nswitch-rcm-nix": { "nswitch-rcm-nix": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1721302286, "lastModified": 1721302286,
@ -1034,13 +969,12 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nix-alien": "nix-alien", "nix-alien": "nix-alien",
"nix-gaming": "nix-gaming",
"nix-index-database": "nix-index-database_2", "nix-index-database": "nix-index-database_2",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_4",
"nixpkgs-stable": "nixpkgs-stable_3", "nixpkgs-stable": "nixpkgs-stable_3",
"nswitch-rcm-nix": "nswitch-rcm-nix", "nswitch-rcm-nix": "nswitch-rcm-nix",
"nur": "nur", "nur": "nur",
@ -1075,7 +1009,7 @@
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_6",
"nixpkgs-stable": "nixpkgs-stable_4" "nixpkgs-stable": "nixpkgs-stable_4"
}, },
"locked": { "locked": {
@ -1104,7 +1038,7 @@
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1720818679, "lastModified": 1720818679,

View file

@ -47,11 +47,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# patches for gaming on nix
nix-gaming = {
url = "github:fufexan/nix-gaming";
};
# hardware quirks on nix # hardware quirks on nix
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware/master"; url = "github:NixOS/nixos-hardware/master";
@ -87,6 +82,7 @@
lanzaboote, lanzaboote,
nixos-hardware, nixos-hardware,
nix-alien, nix-alien,
nixos-generators,
nswitch-rcm-nix, nswitch-rcm-nix,
nix-index-database, nix-index-database,
... ...
@ -151,7 +147,7 @@
modules = modules =
nixModules nixModules
++ [ ++ [
./profiles/onett/nixos.nix ./profles/onett/nixos.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.swarsel.imports = home-manager.users.swarsel.imports =
@ -368,6 +364,13 @@
}; };
packages.x86_64-linux = { packages.x86_64-linux = {
proxmox-lxc = nixos-generators.nixosGenerate {
inherit system;
modules = [
./profiles/server1/TEMPLATE/nixos.nix
];
format = "proxmox-lxc";
};
}; };
}; };
} }

1521
index.html

File diff suppressed because it is too large Load diff

View file

@ -41,11 +41,12 @@
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# is this machine always connected to power? If yes, use this block: # is this machine always connected to power? If yes, use this block:
# #
# programs.waybar.settings.mainBar."custom/pseudobat"= { # programs.waybar.settings.mainBar."custom/pseudobat" = {
# format= ""; # format = "";
# on-click-right= "wlogout -p layer-shell"; # on-click-right = "wlogout -p layer-shell";
# }; # };
# programs.waybar.settings.mainBar.modules-right = ["custom/outer-left-arrow-dark" # programs.waybar.settings.mainBar.modules-right = [
# "custom/outer-left-arrow-dark"
# "mpris" # "mpris"
# "custom/left-arrow-light" # "custom/left-arrow-light"
# "network" # "network"

View file

@ -29,6 +29,7 @@
# nix # nix
alejandra alejandra
nixpkgs-fmt
deadnix deadnix
statix statix
@ -170,7 +171,8 @@
noto-fonts-cjk-sans noto-fonts-cjk-sans
# cura # cura
(let (
let
cura5 = appimageTools.wrapType2 rec { cura5 = appimageTools.wrapType2 rec {
name = "cura5"; name = "cura5";
version = "5.4.0"; version = "5.4.0";
@ -194,7 +196,8 @@
args+=("$a") args+=("$a")
done done
exec "${cura5}/bin/cura5" "''${args[@]}" exec "${cura5}/bin/cura5" "''${args[@]}"
'') ''
)
#E: hides scratchpad depending on state, calls emacsclient for edit and then restores the scratchpad state #E: hides scratchpad depending on state, calls emacsclient for edit and then restores the scratchpad state
(pkgs.writeShellScriptBin "e" '' (pkgs.writeShellScriptBin "e" ''
@ -332,7 +335,10 @@
programs.ssh = { programs.ssh = {
enable = true; enable = true;
extraConfig = "SetEnv TERM=xterm-256color"; forwardAgent = true;
extraConfig = ''
SetEnv TERM=xterm-256color
'';
matchBlocks = { matchBlocks = {
"nginx" = { "nginx" = {
hostname = "192.168.1.14"; hostname = "192.168.1.14";
@ -406,57 +412,18 @@
hostname = "193.122.53.173"; hostname = "193.122.53.173";
user = "root"; #this is a oracle vm server but needs root due to nixos-infect user = "root"; #this is a oracle vm server but needs root due to nixos-infect
}; };
"songdiver" = {
hostname = "89.168.100.65";
user = "ubuntu";
};
"pkv" = { "pkv" = {
hostname = "46.232.248.161"; hostname = "46.232.248.161";
user = "root"; user = "root";
}; };
"nebula" = {
hostname = "128.131.171.15";
user = "amp23s56";
compression = true;
identityFile = "~/.ssh/id_ed25519";
proxyCommand = "ssh -p 1022 -i ~/.ssh/id_ed25519 -q -W %h:%p %r@venus.par.tuwien.ac.at";
extraOptions = {
"TCPKeepAlive" = "yes";
};
};
"efficient" = { "efficient" = {
hostname = "g0.complang.tuwien.ac.at"; hostname = "g0.complang.tuwien.ac.at";
forwardAgent = true; forwardAgent = true;
user = "ep01427399"; user = "ep01427399";
# leaving the below lines in for future reference
# remoteForwards = [
# {
# bind.address = "/run/user/21217/gnupg/S.gpg-agent";
# host.address = "/run/user/1000/gnupg/S.gpg-agent.extra";
# }
# {
# bind.address = "/run/user/21217/gnupg/S.gpg-agent.ssh";
# host.address = "/run/user/1000/gnupg/S.gpg-agent.ssh";
# }
# ];
# extraOptions = {
# "RemoteForward" = "/run/user/21217/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra";
# "StreamLocalBindUnlink" = "yes";
# "RemoteForward" = "/run/user/21217/gnupg/S.gpg-agent.ssh /run/user/1000/gnupg/S.gpg-agent.ssh";
# };
# setEnv = {
# "TERM" = "xterm";
# };
};
"hydra" = {
hostname = "128.131.171.215";
user = "hpc23w33";
compression = true;
forwardAgent = true;
# identityFile = "~/.ssh/id_tuwien_hpc";
# proxyCommand = "ssh -p 1022 -i ~/.ssh/id_tuwien_hpc -q -W %h:%p %r@venus.par.tuwien.ac.at";
proxyCommand = "ssh -p 1022 -q -W %h:%p %r@venus.par.tuwien.ac.at";
extraOptions = {
"TCPKeepAlive" = "yes";
};
}; };
}; };
}; };
@ -550,8 +517,9 @@
pandoc.enable = true; pandoc.enable = true;
fzf.enable = true; fzf.enable = true;
zoxide.enable = true; zoxide.enable = true;
};
nix-index = let programs.nix-index = let
command-not-found = pkgs.runCommandLocal "command-not-found.sh" {} '' command-not-found = pkgs.runCommandLocal "command-not-found.sh" {} ''
mkdir -p $out/etc/profile.d mkdir -p $out/etc/profile.d
substitute ${../../scripts/command-not-found.sh} \ substitute ${../../scripts/command-not-found.sh} \
@ -566,7 +534,6 @@
paths = [command-not-found]; paths = [command-not-found];
}; };
}; };
};
programs.password-store = { programs.password-store = {
enable = true; enable = true;

View file

@ -263,6 +263,31 @@ create a new one."
(while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t) (while (re-search-forward (concat "^" (regexp-quote common-prefix) "\\.") end t)
(replace-match "")))))) (replace-match ""))))))
(defun swarsel/org-nixpkgs-fmt-block-lite ()
(interactive)
(org-babel-mark-block)
(call-interactively 'nixpkgs-fmt-region))
(defun swarsel/org-nixpkgs-fmt-block ()
(interactive)
(save-excursion
(let* ((element (org-element-at-point))
(begin (org-element-property :begin element))
(end (org-element-property :end element))
(lang (org-element-property :language element)))
(when lang
(goto-char begin)
(forward-line)
(insert "{")
(goto-char end)
(forward-line -1)
(beginning-of-line)
(forward-char -1)
(insert "}")
(org-babel-mark-block)
(call-interactively 'nixpkgs-fmt-region)))))
;; Make ESC quit prompts ;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
@ -1074,6 +1099,8 @@ create a new one."
(use-package nix-mode (use-package nix-mode
:mode "\\.nix\\'") :mode "\\.nix\\'")
(use-package nixpkgs-fmt)
(setq markdown-command "pandoc") (setq markdown-command "pandoc")
(use-package markdown-mode (use-package markdown-mode