From 4c07feb21a4f27bd375b15566caf8c2b5c053419 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 29 Aug 2024 19:27:30 +0100 Subject: [PATCH] nixpkgs: init config as separate file --- common/default.nix | 1 + common/nixpkgs.nix | 14 ++++++++++++++ flake.nix | 18 ++++-------------- 3 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 common/nixpkgs.nix diff --git a/common/default.nix b/common/default.nix index 2430901..70050d0 100644 --- a/common/default.nix +++ b/common/default.nix @@ -5,6 +5,7 @@ ./environment.nix ./home-manager.nix ./nginx.nix + ./nixpkgs.nix ./openssh.nix ./security.nix ./zsh.nix diff --git a/common/nixpkgs.nix b/common/nixpkgs.nix new file mode 100644 index 0000000..b11cac9 --- /dev/null +++ b/common/nixpkgs.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, inputs, ... }: + +{ + nixpkgs = { + config = { + allowUnfree = true; + packageOverrides = pkgs: { + agenix = inputs.agenix.packages.${config.nixpkgs.hostPlatform.system}.default; + }; + }; + + overlays = [ inputs.nur.overlay ]; + }; +} diff --git a/flake.nix b/flake.nix index 9b8c1a5..3ca3ae6 100644 --- a/flake.nix +++ b/flake.nix @@ -27,25 +27,15 @@ nodeNixpkgs = { kalessin = import nixpkgs { system = "aarch64-linux"; }; # TODO: this should be generated from the host config somehow }; + specialArgs = { + inherit inputs; + }; }; - defaults = { name, nodes, config, lib, pkgs, ... }: { + defaults = { name, nodes, ... }: { networking.hostName = name; nix.settings.experimental-features = "nix-command flakes"; - nixpkgs.flake.source = nixpkgs; - nix.nixPath = [ "nixpkgs=flake:nixpkgs" ]; - - nixpkgs = { - config = { - allowUnfree = true; - packageOverrides = pkgs: { - agenix = agenix.packages.${config.nixpkgs.hostPlatform.system}.default; - }; - }; - - overlays = [ nur.overlay ]; - }; imports = [ home-manager.nixosModules.home-manager