From 3cce7a1884fca40f0a2b34adf5880735d8d50297 Mon Sep 17 00:00:00 2001 From: Sangmin Kim Date: Thu, 5 Mar 2026 17:37:22 +0900 Subject: [PATCH] refactor(secret): agenix wip --- flake.nix | 30 ++++++++++++++++++++++-------- modules/host-users.nix | 8 ++++++-- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 3c01595..1dfb213 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,10 @@ description = "Nix for Poby's MacOS"; nixConfig = { - substituters = ["https://cache.nixos.org"]; + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org" + ]; }; inputs = let @@ -10,10 +13,12 @@ in { # nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # comment out for unstable version nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-${stableVersion}-darwin"; + home-manager = { - url = "github:nix-community/home-manager/release-25.11"; + url = "github:nix-community/home-manager/release-${stableVersion}"; inputs.nixpkgs.follows = "nixpkgs-darwin"; }; + darwin = { url = "github:nix-darwin/nix-darwin/nix-darwin-${stableVersion}"; inputs.nixpkgs.follows = "nixpkgs-darwin"; @@ -24,6 +29,12 @@ url = "github:notashelf/nvf"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # agenix for secrets + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs-darwin"; + } }; outputs = inputs @ { @@ -32,6 +43,7 @@ darwin, home-manager, nvf, + agenix, ... }: let system = "aarch64-darwin"; @@ -52,15 +64,17 @@ ./modules/system.nix ./modules/apps.nix ./modules/host-users.nix - nvf.darwinModules.default - + agenix.darwinModules.default home-manager.darwinModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = specialArgs; - home-manager.users.${username} = import ./home; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + extraSpecialArgs = specialArgs; + users.${username} = import ./home; + }; } ]; }; diff --git a/modules/host-users.nix b/modules/host-users.nix index c29c73b..5d258d6 100644 --- a/modules/host-users.nix +++ b/modules/host-users.nix @@ -3,10 +3,14 @@ hostname, ... }: { - networking.hostName = hostname; - networking.computerName = hostname; + networking = { + hostName = hostname; + computerName = hostname; + localHostName = hostname; + } users.users."${username}" = { + description = "Sangmin Kim"; home = "/Users/${username}"; description = username; };