From 78b1a5761cb83f1e703aa8b0bf494d1c65c7ac9d Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Sat, 28 Oct 2023 15:51:25 +0200 Subject: [PATCH] cleanup --- flake.lock | 21 ++++----- flake.nix | 3 +- hosts/falkenstein-1/default.nix | 1 - .../falkenstein-1/modules/backup/default.nix | 16 +++---- hosts/nuc/default.nix | 6 +-- hosts/nuc/modules/backup/default.nix | 8 +--- hosts/thinkpad/default.nix | 43 +------------------ hosts/thinkpad/modules/backup/default.nix | 19 +++----- shared/default.nix | 1 + shared/nix.nix | 15 +++++++ shared/zsh.nix | 10 ----- users/rouven/modules/helix/default.nix | 20 ++------- users/rouven/modules/packages.nix | 2 +- 13 files changed, 52 insertions(+), 113 deletions(-) create mode 100644 shared/nix.nix diff --git a/flake.lock b/flake.lock index 447f09e..32c9a1f 100644 --- a/flake.lock +++ b/flake.lock @@ -171,11 +171,11 @@ ] }, "locked": { - "lastModified": 1698250431, - "narHash": "sha256-qs2gTeH4wpnWPO6Oi6sOhp2IhG0i0DzcnrJxIY3/CP8=", + "lastModified": 1698479159, + "narHash": "sha256-rJHBDwW4LbADEfhkgGHjKGfL2dF44NrlyXdXeZrQahs=", "owner": "nix-community", "repo": "home-manager", - "rev": "09587fbbc6a669f7725613e044c2577dc5d43ab5", + "rev": "f92a54fef4eacdbe86b0a2054054dd58b0e2a2a4", "type": "github" }, "original": { @@ -301,17 +301,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1698134075, - "narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=", - "owner": "NixOS", + "lastModified": 1698463958, + "narHash": "sha256-4L0hGqplwNYWFhqhPbsQh6U7s4KiUSE2nhQdCZg981c=", + "owner": "imlonghao", "repo": "nixpkgs", - "rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4", + "rev": "88bc98a073d12dc7e0c8b766a55d39ebeaed9927", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" + "owner": "imlonghao", + "ref": "borgmatic/fix-262020", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-lib": { diff --git a/flake.nix b/flake.nix index 2d978ae..5c26a86 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,8 @@ description = "My nix setup"; inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; + # nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs.url = "github:imlonghao/nixpkgs/borgmatic/fix-262020"; nix-index-database = { url = "github:nix-community/nix-index-database"; diff --git a/hosts/falkenstein-1/default.nix b/hosts/falkenstein-1/default.nix index c0e0320..124fc05 100644 --- a/hosts/falkenstein-1/default.nix +++ b/hosts/falkenstein-1/default.nix @@ -1,6 +1,5 @@ { config, pkgs, ... }: { - nix.settings.experimental-features = [ "nix-command" "flakes" ]; imports = [ # Include the results of the hardware scan. diff --git a/hosts/falkenstein-1/modules/backup/default.nix b/hosts/falkenstein-1/modules/backup/default.nix index 7bf9d88..55e5c79 100644 --- a/hosts/falkenstein-1/modules/backup/default.nix +++ b/hosts/falkenstein-1/modules/backup/default.nix @@ -17,16 +17,12 @@ label = "nuc"; } ]; - storage = { - encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}"; - compression = "lz4"; - }; - retention = { - keep_daily = 7; - keep_weekly = 4; - keep_monthly = 12; - keep_yearly = 3; - }; + encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}"; + compression = "lz4"; + keep_daily = 7; + keep_weekly = 4; + keep_monthly = 12; + keep_yearly = 3; }; }; } diff --git a/hosts/nuc/default.nix b/hosts/nuc/default.nix index 17282ba..d4a4a96 100644 --- a/hosts/nuc/default.nix +++ b/hosts/nuc/default.nix @@ -1,13 +1,12 @@ { config, pkgs, lib, ... }: { - nix.settings.experimental-features = [ "nix-command" "flakes" ]; imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix # ./modules/adguard ./modules/networks - ./modules/backup + # ./modules/backup # ./modules/hydra ./modules/matrix ./modules/nextcloud @@ -23,9 +22,6 @@ tmp.useTmpfs = true; }; services.btrfs.autoScrub.enable = true; - nix.settings = { - auto-optimise-store = true; - }; sops.secrets."store/secretkey" = { }; nix.extraOptions = '' diff --git a/hosts/nuc/modules/backup/default.nix b/hosts/nuc/modules/backup/default.nix index ccf9685..881672f 100644 --- a/hosts/nuc/modules/backup/default.nix +++ b/hosts/nuc/modules/backup/default.nix @@ -12,8 +12,6 @@ services.borgmatic = { enable = true; settings = { - # fix failing check - location = null; source_directories = [ "/var/lib" "/var/log" @@ -25,10 +23,8 @@ path = "/mnt/backup/nuc"; } ]; - storage = { - encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}"; - compression = "lz4"; - }; + encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}"; + compression = "lz4"; retention = { keep_daily = 7; keep_weekly = 4; diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 4ad1be2..db9649c 100755 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -4,7 +4,7 @@ imports = [ ./hardware-configuration.nix - ./modules/backup + # ./modules/backup ./modules/networks ./modules/greetd ./modules/virtualisation @@ -34,44 +34,6 @@ tmp.useTmpfs = true; }; - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - # substituters = [ - # "ssh://nuc.lan" - # ]; - # trusted-public-keys = [ - # "nuc.lan:a9UkVw3AizAKCER1CfNGhx8UOMF4t4UGE3GJ9dmHwJc=" - # ]; - }; - # distributedBuilds = true; - # extraOptions = '' - # builders-use-substitutes = true - # ''; - # buildMachines = [ - # { - # hostName = "nuc.lan"; - # system = "x86_64-linux"; - # protocol = "ssh-ng"; - # maxJobs = 2; - # speedFactor = 1; - # supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - # mandatoryFeatures = [ ]; - # } - # { - # hostName = "quitte.ifsr.de"; - # system = "x86_64-linux"; - # protocol = "ssh-ng"; - # maxJobs = 12; - # sshUser = "rouven.seifert"; - # speedFactor = 10; - # supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - # mandatoryFeatures = [ ]; - # } - # ]; - }; - environment.persistence."/nix/persist/system" = { directories = [ "/etc/nixos" # bind mounted from /nix/persist/system/etc/nixos to /etc/nixos @@ -93,8 +55,6 @@ i18n.defaultLocale = "en_US.UTF-8"; console = { keyMap = "dvorak"; - # font = "Lat2-Terminus16"; - # earlySetup = true; colors = let colors = config.home-manager.users.rouven.colorScheme.colors; in [ colors.base00 @@ -128,6 +88,7 @@ # Enable sound. sound.enable = true; #hardware.pulseaudio.enable = true; + hardware.opengl.enable = true; hardware.bluetooth.enable = true; security = { diff --git a/hosts/thinkpad/modules/backup/default.nix b/hosts/thinkpad/modules/backup/default.nix index e34772b..617fe3f 100644 --- a/hosts/thinkpad/modules/backup/default.nix +++ b/hosts/thinkpad/modules/backup/default.nix @@ -5,8 +5,7 @@ services.borgmatic = { enable = true; settings = { - # fix failing check - location = null; + location = { }; source_directories = [ "/var/lib" "/var/log" @@ -34,16 +33,12 @@ "/home/*/.local/share" "/home/*/Linux/Isos" ]; - storage = { - encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}"; - compression = "lz4"; - }; - retention = { - keep_daily = 7; - keep_weekly = 4; - keep_monthly = 12; - keep_yearly = 3; - }; + encryption_passcommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets."borg/passphrase".path}"; + compression = "lz4"; + keep_daily = 7; + keep_weekly = 4; + keep_monthly = 12; + keep_yearly = 3; }; }; } diff --git a/shared/default.nix b/shared/default.nix index 415d706..86b38d0 100644 --- a/shared/default.nix +++ b/shared/default.nix @@ -6,6 +6,7 @@ ./gpg.nix ./sops.nix ./vim.nix + ./nix.nix ./tmux.nix ./yazi.nix ./zsh.nix diff --git a/shared/nix.nix b/shared/nix.nix new file mode 100644 index 0000000..6dda9be --- /dev/null +++ b/shared/nix.nix @@ -0,0 +1,15 @@ +{ config, lib, nixpkgs, ... }: +{ + nix = { + # expose all flake inputs through nix Path and registry + registry = { + nixpkgs.flake = nixpkgs; + }; + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + # keep build-time deps around for offline-rebuilding + settings = { + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" "repl-flake" ]; + }; + }; +} diff --git a/shared/zsh.nix b/shared/zsh.nix index fb8b534..0ce39fb 100644 --- a/shared/zsh.nix +++ b/shared/zsh.nix @@ -81,16 +81,6 @@ echo System package diff: ${config.nix.package}/bin/nix store diff-closures $(command ls -d /nix/var/nix/profiles/system-* | tail -2) } - - shell() { - unset PKGS - for var in "$@" - do - PKGS=$PKGS\ nixpkgs/nixos-unstable\\#$var - done - eval ${pkgs.nix-output-monitor}/bin/nom shell $PKGS - } - ''; promptInit = '' diff --git a/users/rouven/modules/helix/default.nix b/users/rouven/modules/helix/default.nix index 392db6e..b66b43e 100644 --- a/users/rouven/modules/helix/default.nix +++ b/users/rouven/modules/helix/default.nix @@ -26,27 +26,15 @@ programs.helix = { enable = true; - ## use after helix update - # languages = { - # language-server.rnix-lsp = { - # command = "rnix-lsp"; - # }; - # language = [ - # { - # name = "nix"; - # auto-format = true; - # language-servers = [ "rnix-lsp" ]; - # } - # ]; - # }; - - ## old version languages = { + language-server.rnix-lsp = { + command = "rnix-lsp"; + }; language = [ { name = "nix"; auto-format = true; - language-server.command = "rnix-lsp"; + language-servers = [ "rnix-lsp" ]; } ]; }; diff --git a/users/rouven/modules/packages.nix b/users/rouven/modules/packages.nix index 24be2c1..77ddddd 100644 --- a/users/rouven/modules/packages.nix +++ b/users/rouven/modules/packages.nix @@ -48,7 +48,6 @@ in element-desktop gomuks # alternative matrix client mattermost-desktop - gajim # games # dwarf-fortress-packages.dwarf-fortress-full @@ -89,6 +88,7 @@ in # libs libyubikey libfido2 + python311Packages.pyhanko ]; services.kdeconnect = {