Home

dotnix @836afecb75299df857f38da5eebfa37730bf634d - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / flake.nix
- raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
{
  description = "jolheiser's nixos config";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
    ragenix.url = "github:yaxitech/ragenix";
    ragenix.inputs.nixpkgs.follows = "nixpkgs";
    flake-utils.url = "github:numtide/flake-utils";

    nur.url = "github:nix-community/nur";
    jolheiser-nur.url = "git+https://git.jojodev.com/jolheiser/nur";
  };

  nixConfig = {warn-dirty = false;};

  outputs = {
    self,
    nixpkgs,
    home-manager,
    ragenix,
    jolheiser-nur,
    ...
  } @ inputs: let
    overlays = final: prev: {
      nur = import inputs.nur {
        nurpkgs = prev;
        pkgs = prev;
        repoOverrides = {
          jolheiser = import jolheiser-nur {pkgs = prev;};
        };
      };
    };
    commonConfig = {username}: ({
      config,
      pkgs,
      ...
    }: {
      config = {
        nixpkgs.overlays = [overlays];
        home-manager = {
          useGlobalPkgs = true;
          useUserPackages = true;
          users.${username}.imports = [./apps];
          extraSpecialArgs = {
            flakePath = "/home/${username}/.config/nixpkgs";
          };
        };
        age.secrets = {
          ssh-config = {
            file = ./secrets/shared/ssh-config.age;
            owner = "jolheiser";
          };
          ssh-config-work = {
            file = ./secrets/shared/ssh-config-work.age;
            owner = "jolheiser";
          };
          "nushell.nu" = {
            file = ./secrets/shared/nushell.nu.age;
            owner = "jolheiser";
          };
          spotify-pw = {
            file = ./secrets/shared/spotify-pw.age;
            owner = "jolheiser";
          };
        };
      };
    });
  in
    {
      nixosConfigurations = {
        "chai" = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            home-manager.nixosModules.home-manager
            ragenix.nixosModules.default
            ./machines/common
            ./machines/chai
            (commonConfig {username = "jolheiser";})
            ({pkgs, ...}: {
              home-manager.users.jolheiser.programs.git.package = pkgs.gitSVN;
            })
          ];
        };
        "matcha" = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            home-manager.nixosModules.home-manager
            ragenix.nixosModules.default
            ./machines/common
            ./machines/matcha
            (commonConfig {username = "jolheiser";})
          ];
        };
      };
    }
    // inputs.flake-utils.lib.eachDefaultSystem (system: let
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      devShells.default = pkgs.mkShell {
        nativeBuildInputs = with pkgs; [
          just
          ragenix.packages.${system}.ragenix
        ];
      };
    });
}