Skyler Grey | 0409e46 | 2022-08-19 23:40:48 +0100 | [diff] [blame] | 1 | { |
| 2 | description = "Minion's NixOS configuration (since 2022-08-19)"; |
Skyler Grey | bcb2cb7 | 2022-08-21 07:24:35 +0100 | [diff] [blame] | 3 | inputs = { |
| 4 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
| 5 | flake-utils.url = "github:numtide/flake-utils"; |
| 6 | registry = { |
| 7 | url = "github:nixos/flake-registry"; |
| 8 | flake = false; |
| 9 | }; |
| 10 | home-manager.url = "github:nix-community/home-manager/release-22.05"; |
| 11 | sops-nix.url = "github:Mic92/sops-nix"; |
| 12 | impermanence.url = "github:nix-community/impermanence"; |
| 13 | |
| 14 | home-manager.inputs.nixpkgs.follows = "nixpkgs"; |
| 15 | sops-nix.inputs.nixpkgs.follows = "nixpkgs"; |
| 16 | impermanence.inputs.nixpkgs.follows = "nixpkgs"; |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 17 | }; |
Skyler Grey | 0409e46 | 2022-08-19 23:40:48 +0100 | [diff] [blame] | 18 | |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 19 | outputs = inputs: let |
| 20 | inherit (inputs) self nixpkgs flake-utils; |
| 21 | in |
Skyler Grey | 0409e46 | 2022-08-19 23:40:48 +0100 | [diff] [blame] | 22 | flake-utils.lib.eachDefaultSystem (system: let |
| 23 | pkgs = nixpkgs.legacyPackages.${system}; |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 24 | |
Skyler Grey | bcb2cb7 | 2022-08-21 07:24:35 +0100 | [diff] [blame] | 25 | utils = import ./utils/utils.nix nixpkgs.lib; |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 26 | |
| 27 | username = "minion"; |
Skyler Grey | 0409e46 | 2022-08-19 23:40:48 +0100 | [diff] [blame] | 28 | in { |
Skyler Grey | bcb2cb7 | 2022-08-21 07:24:35 +0100 | [diff] [blame] | 29 | packages.nixosConfigurations = { |
| 30 | default = nixpkgs.lib.nixosSystem { |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 31 | inherit system; |
| 32 | |
Skyler Grey | bcb2cb7 | 2022-08-21 07:24:35 +0100 | [diff] [blame] | 33 | modules = [ |
| 34 | (nixpkgs.lib.pipe ./modules [ |
| 35 | utils.nixFilesIn |
| 36 | utils.importAll |
| 37 | (utils.interpretNonstandardModule (args: |
| 38 | args |
| 39 | // { |
| 40 | home = args.config.home-manager."${username}"; |
| 41 | })) |
| 42 | ]) |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 43 | ]; |
| 44 | |
Skyler Grey | bcb2cb7 | 2022-08-21 07:24:35 +0100 | [diff] [blame] | 45 | specialArgs = inputs // {inherit username pkgs;}; |
Skyler Grey | 7dfe5c6 | 2022-08-20 21:41:30 +0100 | [diff] [blame] | 46 | }; |
| 47 | }; |
Skyler Grey | 0409e46 | 2022-08-19 23:40:48 +0100 | [diff] [blame] | 48 | devShell = pkgs.mkShell { |
| 49 | nativeBuildInputs = with pkgs; [nodePackages.prettier alejandra]; |
| 50 | buildInputs = []; |
| 51 | }; |
| 52 | formatter = pkgs.alejandra; |
| 53 | }); |
| 54 | } |