diff options
| author | David Morgan <djm_uk@protonmail.com> | 2025-07-24 13:18:02 +0100 |
|---|---|---|
| committer | David Morgan <djm_uk@protonmail.com> | 2025-07-24 13:18:02 +0100 |
| commit | 3ea4f07c68f5054bbe392ed68d78d1bdacfee61a (patch) | |
| tree | e5ff3d05941701f26aef8dd43baa066ae1a880fe | |
| parent | b971a881c6e9ccae612f55caeea072acb785950a (diff) | |
| download | dotfiles-3ea4f07c68f5054bbe392ed68d78d1bdacfee61a.tar.gz | |
WIP
| -rw-r--r-- | nix-conf/home/TODO | 4 | ||||
| -rw-r--r-- | nix-conf/home/flake.lock | 66 | ||||
| -rw-r--r-- | nix-conf/home/flake.nix | 27 | ||||
| -rw-r--r-- | nix-conf/home/includes/common.nix | 29 | ||||
| -rw-r--r-- | nix-conf/home/otm.nix | 32 |
5 files changed, 108 insertions, 50 deletions
diff --git a/nix-conf/home/TODO b/nix-conf/home/TODO index a5a749f..147ad1f 100644 --- a/nix-conf/home/TODO +++ b/nix-conf/home/TODO @@ -1,3 +1 @@ -- sops channel -- unstable channel -- use /etc/ssl/cert.pem ? +- structure/multiple systems diff --git a/nix-conf/home/flake.lock b/nix-conf/home/flake.lock index 92e9af9..20d3df0 100644 --- a/nix-conf/home/flake.lock +++ b/nix-conf/home/flake.lock @@ -1,5 +1,18 @@ { "nodes": { + "darwin-system-certs": { + "flake": false, + "locked": { + "lastModified": 1746337162, + "narHash": "sha256-nnYgKXmhL+DfaiQfk9y5fEZL+pDb7OuB9gsAo1JBv+Q=", + "path": "/private/etc/ssl/cert.pem", + "type": "path" + }, + "original": { + "path": "/private/etc/ssl/cert.pem", + "type": "path" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -7,11 +20,11 @@ ] }, "locked": { - "lastModified": 1753181343, - "narHash": "sha256-CLQfNtUqirNVSYoW/kYbvL4PeeNasmZonaPnjO3+1YQ=", + "lastModified": 1753294394, + "narHash": "sha256-1Dfgq09lHZ8AdYB2Deu/mYP1pMNpob8CgqT5Mzo44eI=", "owner": "nix-community", "repo": "home-manager", - "rev": "0cdfcdbb525b77b951c889b6131047bc374f48fe", + "rev": "1fde6fb1be6cd5dc513dc1c287d69e4eb2de973e", "type": "github" }, "original": { @@ -22,11 +35,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1752950548, - "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", + "lastModified": 1753250450, + "narHash": "sha256-i+CQV2rPmP8wHxj0aq4siYyohHwVlsh40kV89f3nw1s=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", + "rev": "fc02ee70efb805d3b2865908a13ddd4474557ecf", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1753250450, + "narHash": "sha256-i+CQV2rPmP8wHxj0aq4siYyohHwVlsh40kV89f3nw1s=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fc02ee70efb805d3b2865908a13ddd4474557ecf", "type": "github" }, "original": { @@ -38,8 +67,31 @@ }, "root": { "inputs": { + "darwin-system-certs": "darwin-system-certs", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752544651, + "narHash": "sha256-GllP7cmQu7zLZTs9z0J2gIL42IZHa9CBEXwBY9szT0U=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "2c8def626f54708a9c38a5861866660395bb3461", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" } } }, diff --git a/nix-conf/home/flake.nix b/nix-conf/home/flake.nix index 699bc6f..acb3bf2 100644 --- a/nix-conf/home/flake.nix +++ b/nix-conf/home/flake.nix @@ -2,30 +2,39 @@ description = "Home Manager configuration of dmorgan"; inputs = { - # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + darwin-system-certs = { + url = "/private/etc/ssl/cert.pem"; + flake = false; + }; }; outputs = - { nixpkgs, home-manager, ... }: + { nixpkgs, nixpkgs-unstable, home-manager, sops-nix, ... }@inputs: let system = "aarch64-darwin"; pkgs = nixpkgs.legacyPackages.${system}; + overlay-unstable = final: prev: { + unstable = nixpkgs-unstable.legacyPackages.${system}; + }; in { homeConfigurations."dmorgan" = home-manager.lib.homeManagerConfiguration { inherit pkgs; - - # Specify your home configuration modules here, for example, - # the path to your home.nix. - modules = [ ./otm.nix ]; - - # Optionally use extraSpecialArgs - # to pass through arguments to home.nix + extraSpecialArgs = { inherit inputs system; }; + modules = [ + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + ./otm.nix + ]; }; }; } diff --git a/nix-conf/home/includes/common.nix b/nix-conf/home/includes/common.nix index 3917715..c00eaf2 100644 --- a/nix-conf/home/includes/common.nix +++ b/nix-conf/home/includes/common.nix @@ -2,17 +2,17 @@ config, lib, pkgs, + inputs, ... }: let hcr = pkgs.callPackage ./scripts/hm-changes-report.nix { inherit config pkgs; }; scr = pkgs.callPackage ./scripts/system-changes-report.nix { inherit config pkgs; }; - #unstable = import <unstable> { }; in { imports = [ ./zsh.nix - #<sops-nix/modules/home-manager/sops.nix> + inputs.sops-nix.homeManagerModules.sops ]; nixpkgs.config.allowUnfreePredicate = @@ -28,15 +28,15 @@ in }; }; - #sops = { - # age.keyFile = "${config.xdg.configHome}/sops/age/keys.txt"; - # defaultSopsFile = builtins.path { - # path = ./secrets.yaml; - # name = "home-secrets.yaml"; - # }; - # secrets."ssh_config/oci" = { }; - # secrets."git_email_config/default" = { }; - #}; + sops = { + age.keyFile = "${config.xdg.configHome}/sops/age/keys.txt"; + defaultSopsFile = builtins.path { + path = ./secrets.yaml; + name = "home-secrets.yaml"; + }; + secrets."ssh_config/oci" = { }; + secrets."git_email_config/default" = { }; + }; home.sessionVariables = { LSP_USE_PLISTS = "true"; @@ -106,8 +106,7 @@ in zip zstd - # TODO - #unstable.nixfmt-rfc-style + unstable.nixfmt-rfc-style ]; programs.bat = { @@ -215,7 +214,7 @@ in ''; includes = [ "~/.ssh/config_local" - #config.sops.secrets."ssh_config/oci".path + config.sops.secrets."ssh_config/oci".path ]; matchBlocks = { "djm.ovh" = { @@ -283,7 +282,7 @@ in programs.git = { enable = true; userName = "David Morgan"; - #includes = [ { path = config.sops.secrets."git_email_config/default".path; } ]; + includes = [ { path = config.sops.secrets."git_email_config/default".path; } ]; aliases = { # difftastic logt = "!sh -c 'GIT_EXTERNAL_DIFF=\"difft --background=dark\" git log -p --ext-diff'"; diff --git a/nix-conf/home/otm.nix b/nix-conf/home/otm.nix index 38ad2b5..3dc3277 100644 --- a/nix-conf/home/otm.nix +++ b/nix-conf/home/otm.nix @@ -2,6 +2,7 @@ config, lib, pkgs, + inputs, ... }: let @@ -91,8 +92,7 @@ let + zscaler-cert; full-cert = - #(builtins.readFile /etc/ssl/cert.pem) + # TODO can this be an input? - aws-cert + internal-cert + internal-staging-cert; + (builtins.readFile inputs.darwin-system-certs) + aws-cert + internal-cert + internal-staging-cert; zscaler-cert-file = pkgs.writeText "zscaler-cert.pem" zscaler-cert; aws-cert-file = pkgs.writeText "aws-cert.pem" aws-cert; @@ -166,10 +166,10 @@ in ".wgetrc".text = "ca_certificate=${full-cert-file}"; }; - #sops.secrets = { - # "git_email_config/otm" = { }; - # "ssh_config/otm" = { }; - #}; + sops.secrets = { + "git_email_config/otm" = { }; + "ssh_config/otm" = { }; + }; programs.java = { enable = true; @@ -179,15 +179,15 @@ in programs.git = { signing.signByDefault = lib.mkForce false; includes = lib.mkForce [ - #{ path = config.sops.secrets."git_email_config/otm".path; } - #{ - # path = config.sops.secrets."git_email_config/default".path; - # condition = "gitdir:~/src/personal/"; - #} - #{ - # path = config.sops.secrets."git_email_config/default".path; - # condition = "gitdir:~/dotfiles/"; - #} + { path = config.sops.secrets."git_email_config/otm".path; } + { + path = config.sops.secrets."git_email_config/default".path; + condition = "gitdir:~/src/personal/"; + } + { + path = config.sops.secrets."git_email_config/default".path; + condition = "gitdir:~/dotfiles/"; + } { contents = { commit.gpgSign = true; @@ -219,7 +219,7 @@ in ]; }; programs.ssh = { - #includes = [ config.sops.secrets."ssh_config/otm".path ]; + includes = [ config.sops.secrets."ssh_config/otm".path ]; matchBlocks = { "github.com" = lib.mkForce { hostname = "github.com"; |