blob: 701ba472362c7005f460bfea641ec6c3ecb2c0e2 [file] [log] [blame]
Skyler Grey0409e462022-08-19 23:40:48 +01001{
2 description = "Minion's NixOS configuration (since 2022-08-19)";
Skyler Greybcb2cb72022-08-21 07:24:35 +01003 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 Grey7dfe5c62022-08-20 21:41:30 +010017 };
Skyler Grey0409e462022-08-19 23:40:48 +010018
Skyler Grey7dfe5c62022-08-20 21:41:30 +010019 outputs = inputs: let
20 inherit (inputs) self nixpkgs flake-utils;
21 in
Skyler Grey0409e462022-08-19 23:40:48 +010022 flake-utils.lib.eachDefaultSystem (system: let
Skyler Greyf649adf2022-08-26 06:47:44 +010023 pkgs = import nixpkgs {
24 inherit system;
25 overlays = import ./overlays nixpkgs.lib;
26 };
Skyler Grey7dfe5c62022-08-20 21:41:30 +010027
Skyler Greyf649adf2022-08-26 06:47:44 +010028 utils = import ./utils nixpkgs.lib;
Skyler Grey7dfe5c62022-08-20 21:41:30 +010029
30 username = "minion";
Skyler Grey0409e462022-08-19 23:40:48 +010031 in {
Skyler Greybcb2cb72022-08-21 07:24:35 +010032 packages.nixosConfigurations = {
33 default = nixpkgs.lib.nixosSystem {
Skyler Grey7dfe5c62022-08-20 21:41:30 +010034 inherit system;
35
Skyler Greybcb2cb72022-08-21 07:24:35 +010036 modules = [
37 (nixpkgs.lib.pipe ./modules [
38 utils.nixFilesIn
Skyler Greybcb2cb72022-08-21 07:24:35 +010039 (utils.interpretNonstandardModule (args:
40 args
41 // {
Skyler Greyf649adf2022-08-26 06:47:44 +010042 home = args.config.home-manager.users.${username};
Skyler Greybcb2cb72022-08-21 07:24:35 +010043 }))
44 ])
Skyler Greyf649adf2022-08-26 06:47:44 +010045 {
46 minion = import ./config.nix;
47 }
Skyler Grey7dfe5c62022-08-20 21:41:30 +010048 ];
49
Skyler Greybcb2cb72022-08-21 07:24:35 +010050 specialArgs = inputs // {inherit username pkgs;};
Skyler Grey7dfe5c62022-08-20 21:41:30 +010051 };
52 };
Skyler Grey0409e462022-08-19 23:40:48 +010053 devShell = pkgs.mkShell {
54 nativeBuildInputs = with pkgs; [nodePackages.prettier alejandra];
55 buildInputs = [];
56 };
57 formatter = pkgs.alejandra;
58 });
59}