Home

dotnix @65c51b14161f6393ec9a819cefb6f02e54a77d9a - 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
  description = "jolheiser's nixos config";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    agenix = {
      url = "github:ryantm/agenix";
      inputs = {
        darwin.follows = "";
        home-manager.follows = "home-manager";
        nixpkgs.follows = "nixpkgs";
      };
    };
    nixos-hardware.url = "github:nixos/nixos-hardware/master";
    nur.url = "github:nix-community/NUR";
    helix.url = "git+https://git.jolheiser.com/helix.drv.git";
    gomodinit.url = "git+https://git.jolheiser.com/gomodinit.git";
    cfg.url = "git+https://git.jolheiser.com/cfg.git";
    spectre.url = "git+https://git.jolheiser.com/go-spectre.git";
    pokego.url = "git+https://git.jolheiser.com/pokego.git";
    ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
    tclip.url = "github:tailscale-dev/tclip";
  };

  outputs =
    {
      nixpkgs,
      home-manager,
      nixos-hardware,
      agenix,
      ...
    }@inputs:
    let
      overlays = [
        (_: prev: {
          nur = import inputs.nur {
            nurpkgs = prev;
            pkgs = prev;
          };
          jolheiser = {
            helix = inputs.helix.packages.${prev.system}.default;
            gomodinit = inputs.gomodinit.packages.${prev.system}.default;
            cfg = inputs.cfg.packages.${prev.system}.default;
            spectre = inputs.spectre.packages.${prev.system}.default;
            pokego = inputs.pokego.packages.${prev.system}.default;
          };
          tclip = inputs.tclip.packages.${prev.system}.tclip;
          ghostty = inputs.ghostty.packages.${prev.system}.ghostty;
        })
      ];
      pkgs = import inputs.nixpkgs {
        inherit overlays system;
        config.allowUnfree = true;
      };
      commonConfig =
        { config, ... }:
        {
          config = {
            nixpkgs.overlays = overlays;
          };
        };
      username = "jolheiser";
      system = "x86_64-linux";
      homeManagerModules = [
        agenix.homeManagerModules.age
        {
          home = {
            inherit username;
            homeDirectory = "/home/${username}";
          };
          age = {
            secretsDir = "/home/${username}/.agenix/agenix";
            secretsMountPoint = "/home/${username}/.agenix/agenix.d";
            identityPaths = [ "/home/${username}/.ssh/nix" ];
            secrets = {
              ssh-config.file = ./secrets/ssh-config.age;
              spotify = {
                file = ./secrets/spotify.age;
                path = "/home/${username}/.cache/spotify-player/credentials.json";
              };
              irc-pw.file = ./secrets/irc-pw.age;
              spectre-pw.file = ./secrets/spectre-pw.age;
              git-send-email.file = ./secrets/git-send-email.age;
              cachix = {
                file = ./secrets/cachix.age;
                path = "/home/${username}/.config/cachix/cachix.dhall";
              };
              llm = {
                file = ./secrets/llm.age;
                path = "/home/${username}/.config/io.datasette.llm/keys.json";
              };
            };
          };
        }
        ./apps/gui
      ];
    in
    {
      inherit homeManagerModules;
      homeConfigurations = {
        "jolheiser" = home-manager.lib.homeManagerConfiguration {
          inherit pkgs;
          modules = homeManagerModules ++ [ ./apps/de ];
        };
      };
      nixosConfigurations = {
        "genmaicha" = nixpkgs.lib.nixosSystem {
          inherit system;
          modules = [
            nixos-hardware.nixosModules.framework-13-7040-amd
            ./machines/genmaicha
            commonConfig
          ];
        };
        "sencha" = nixpkgs.lib.nixosSystem {
          inherit system;
          modules = [
            ./machines/sencha
            commonConfig
          ];
        };
      };
      nixConfig = {
        extra-substitutors = [ "https://jolheiser.cachix.org" ];
        extra-trusted-public-keys = [
          "jolheiser.cachix.org-1:fiKkfTuHFqDK5ZOVxcqb4InUkKsrTvtMLISid7XvuVg="
        ];
      };
      devShells.${system}.default = pkgs.mkShell {
        nativeBuildInputs = [
          agenix.packages.${system}.agenix
        ];
      };
    };
}