diff --git a/modules/ci-runner/default.nix b/modules/ci-runner/default.nix index 95c58970..869777f3 100644 --- a/modules/ci-runner/default.nix +++ b/modules/ci-runner/default.nix @@ -2,7 +2,7 @@ lib, config, pkgs, - self, + flake, ... }: with lib; let @@ -37,7 +37,7 @@ in { }; age.secrets."drone-runner-exec-config" = { - file = "${self}/secrets/drone-runner-exec-config"; + file = "${flake.self}/secrets/drone-runner-exec-config"; mode = "700"; owner = psCfg.user.name; }; diff --git a/modules/core/default.nix b/modules/core/default.nix index 5f6161de..6b85b9df 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -12,7 +12,6 @@ in { ./fonts.nix ./i18n.nix ./networking.nix - ./nix.nix ./packages.nix ./services.nix ]; diff --git a/modules/core/networking.nix b/modules/core/networking.nix index fa91046e..c4e025b3 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -35,7 +35,7 @@ in { networking.networkmanager = { # Enable networkmanager. REMEMBER to add yourself to group in order to use nm related stuff. - enable = true; + enable = lib.mkDefault true; wifi.backend = "iwd"; }; diff --git a/modules/docker-ci-runner/default.nix b/modules/docker-ci-runner/default.nix index 6a15f928..9d24bf03 100644 --- a/modules/docker-ci-runner/default.nix +++ b/modules/docker-ci-runner/default.nix @@ -2,7 +2,6 @@ lib, config, pkgs, - self, ... }: with lib; let diff --git a/modules/docker/default.nix b/modules/docker/default.nix index e4558255..6062c794 100644 --- a/modules/docker/default.nix +++ b/modules/docker/default.nix @@ -14,7 +14,8 @@ in { config = mkIf cfg.enable { virtualisation.docker.enable = true; - virtualisation.docker.package = pkgs.docker_24; + # unstable + #virtualisation.docker.package = pkgs.docker_24; users.users = with pkgs; pkgs.lib.setAttrByPath [psCfg.user.name] { extraGroups = ["docker"]; diff --git a/modules/home-assistant/default.nix b/modules/home-assistant/default.nix index 877cfc92..935b1541 100644 --- a/modules/home-assistant/default.nix +++ b/modules/home-assistant/default.nix @@ -3,18 +3,17 @@ config, options, pkgs, - inputs, + flake, ... }: with lib; let cfg = config.pub-solar.home-assistant; - unstable = import {}; in { imports = [ ./home-assistant.nix ./mqtt.nix ./zigbee.nix - (inputs.latest + "/nixos/modules/services/home-automation/home-assistant.nix") + (flake.inputs.unstable + "/nixos/modules/services/home-automation/home-assistant.nix") ]; disabledModules = [ diff --git a/modules/nix-path.nix b/modules/nix-path.nix deleted file mode 100644 index 5967fd2e..00000000 --- a/modules/nix-path.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - channel, - inputs, - ... -}: { - nix.nixPath = [ - "nixpkgs=${channel.input}" - "nixos-config=${../lib/compat/nixos}" - "home-manager=${inputs.home}" - ]; -} diff --git a/modules/core/nix.nix b/modules/nix/default.nix similarity index 81% rename from modules/core/nix.nix rename to modules/nix/default.nix index 1551ffcb..92af6ac4 100644 --- a/modules/core/nix.nix +++ b/modules/nix/default.nix @@ -2,7 +2,7 @@ config, pkgs, lib, - inputs, + flake, ... }: { nix = { @@ -10,6 +10,7 @@ package = pkgs.nix; gc.automatic = true; optimise.automatic = true; + settings = { # Improve nix store disk usage auto-optimise-store = true; @@ -20,6 +21,7 @@ # Allow only group wheel to connect to the nix daemon allowed-users = ["@wheel"]; }; + # Generally useful nix option defaults extraOptions = lib.mkForce '' experimental-features = flakes nix-command @@ -28,5 +30,11 @@ keep-derivations = true fallback = true ''; + + nixPath = [ + "nixpkgs=${flake.inputs.nixpkgs}" + "nixos-config=${../../lib/compat/nixos}" + "home-manager=${flake.inputs.home-manager}" + ]; }; } diff --git a/modules/printing/default.nix b/modules/printing/default.nix index 77f782f7..9eb5547e 100644 --- a/modules/printing/default.nix +++ b/modules/printing/default.nix @@ -13,6 +13,7 @@ in { }; config = mkIf cfg.enable { + nixpkgs.config.allowUnfree = true; services.avahi.enable = true; services.avahi.nssmdns = true; services.avahi.publish.enable = true; diff --git a/modules/terminal-life/bash/default.nix b/modules/terminal-life/bash/default.nix index 29698df0..f40d1c26 100644 --- a/modules/terminal-life/bash/default.nix +++ b/modules/terminal-life/bash/default.nix @@ -1,7 +1,6 @@ { config, pkgs, - self, ... }: let psCfg = config.pub-solar; @@ -104,8 +103,6 @@ in { irssi = "irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_DATA_HOME/irssi"; drone = "DRONE_TOKEN=$(secret-tool lookup drone token) drone"; no = "manix \"\" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview=\"manix '{}'\" | xargs manix"; - # fix nixos-option - nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; myip = "dig +short myip.opendns.com @208.67.222.222 2>&1"; nnn = "nnn -d -e -H -r"; }; diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index a81072ac..a8ffbc60 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -2,7 +2,6 @@ lib, config, pkgs, - self, ... }: with lib; let @@ -57,7 +56,7 @@ in { programs.bash = import ./bash { inherit config; inherit pkgs; - inherit self; + inherit lib; }; programs.neovim = import ./nvim { inherit config; diff --git a/modules/terminal-life/nvim/default.nix b/modules/terminal-life/nvim/default.nix index 9f173db1..9cc2abcf 100644 --- a/modules/terminal-life/nvim/default.nix +++ b/modules/terminal-life/nvim/default.nix @@ -20,8 +20,7 @@ in { withRuby = true; withPython3 = true; - extraPackages = with pkgs; - lib.mkIf (!cfg.lite) [ + extraPackages = with pkgs; lib.mkIf (!cfg.lite) ([ ansible-language-server ccls gopls @@ -43,16 +42,13 @@ in { terraform-ls rnix-lsp universal-ctags - ] - - ++ lib.optionals (!cfg.lite) [ + ] ++ lib.optionals (!cfg.lite) [ gopls python3Full - ]; + ]); plugins = with pkgs.vimPlugins; - [] - ++ lib.optionals (!cfg.lite) [ + [ (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.ini p.json