From abab971ba65b74ba4928c674c96244da8d9ef92b Mon Sep 17 00:00:00 2001 From: andromeda Date: Tue, 30 Dec 2025 00:21:26 +0100 Subject: modularise, combine --- flake.nix | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dad3a4f --- /dev/null +++ b/flake.nix @@ -0,0 +1,73 @@ +{ + inputs = { + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + impermanence.url = "github:nix-community/impermanence"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + noshell = { + url = "github:viperML/noshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur = { + url = "github:nix-community/NUR"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nvf = { + url = "github:notashelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + stylix = { + url = "github:nix-community/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = { + home-manager, + impermanence, + nixpkgs, + noshell, + nur, + nvf, + stylix, + ... + }: let + laptop = import ./machines/laptop.nix; + in { + nixosConfigurations.${laptop.hostname} = nixpkgs.lib.nixosSystem { + system = laptop.system; + specialArgs = {machine = laptop;}; + modules = [ + home-manager.nixosModules.home-manager + { + nixpkgs.overlays = [nur.overlays.default]; + home-manager.useGlobalPkgs = true; + home-manager.extraSpecialArgs = { + machine = laptop; + }; + home-manager.users = + builtins.mapAttrs + (name: value: value) + ( + nixpkgs.legacyPackages.${laptop.system}.lib.genAttrs + laptop.usernames + ( + name: { + imports = [ + stylix.homeModules.stylix + nvf.homeManagerModules.default + ./users/${name}/home.nix + ]; + } + ) + ); + } + impermanence.nixosModules.impermanence + noshell.nixosModules.default + ./configuration.nix + ./hardware-configuration.nix + ]; + }; + }; +} -- cgit v1.3