From 3de4d2f6d51c5880b9b22de5f8fe51d9db7614ee Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:26:42 -0600 Subject: [PATCH 01/36] how is this --- hosts/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index 92b7ef89..7f41af08 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,10 @@ -{ self, inputs, system, ... }: +{ self, inputs, system, ... } : +let + nixosSystem = args: + inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args); + darwinSystem = args: + inputs.nix-darwin.lib.darwinSystem ({ specialArgs = { inherit inputs; }; } // args); +in { flake = { nixosConfigurations = { @@ -37,8 +43,9 @@ ./yuan-mac.nix ]; }; - WK01174 = self.nixos-flake.lib.mkMacosSystem "aarch64-darwin" { - imports = [ + WK01174 = darwinSystem { + system = "aarch64-darwin"; + modules = [ inputs.self.nixosModules.common inputs.self.nixosModules.darwin ./wk01174.nix From c063655462b210c9e7467887b843ad46f0bf8f77 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:28:35 -0600 Subject: [PATCH 02/36] how is this --- hosts/default.nix | 4 +--- hosts/wf17084.nix | 8 +++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index 7f41af08..e05c0514 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -46,9 +46,7 @@ in WK01174 = darwinSystem { system = "aarch64-darwin"; modules = [ - inputs.self.nixosModules.common - inputs.self.nixosModules.darwin - ./wk01174.nix + ./wk01174.nix ]; }; wf17084 = self.nixos-flake.lib.mkMacosSystem "x86_64-darwin" { diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 0206ceb3..c53f5f9d 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -1,4 +1,10 @@ -{ pkgs, config, ... }: { +{ pkgs, inputs, config, ... }: { + + imports = [ + inputs.self.nixosModules.common + inputs.self.nixosModules.darwin + + ]; my = { username = "yuanwang"; From d021567b5c11dd0b0d3cb757834b0d35208f0a87 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:40:23 -0600 Subject: [PATCH 03/36] wip --- hosts/default.nix | 10 +++++----- hosts/wf17084.nix | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index e05c0514..89adbc81 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,4 +1,4 @@ -{ self, inputs, system, ... } : +{ self, inputs, system, ... }: let nixosSystem = args: inputs.nixpkgs.lib.nixosSystem ({ specialArgs = { inherit inputs; }; } // args); @@ -43,10 +43,10 @@ in ./yuan-mac.nix ]; }; - WK01174 = darwinSystem { - system = "aarch64-darwin"; - modules = [ - ./wk01174.nix + WK01174 = darwinSystem { + system = "aarch64-darwin"; + modules = [ + ./wk01174.nix ]; }; wf17084 = self.nixos-flake.lib.mkMacosSystem "x86_64-darwin" { diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index c53f5f9d..8084b387 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -1,12 +1,11 @@ -{ pkgs, inputs, config, ... }: { +{ pkgs, inputs, config, ... }: +{ - imports = [ - inputs.self.nixosModules.common - inputs.self.nixosModules.darwin - - ]; - - my = { + imports = [ + inputs.self.nixosModules.common + inputs.self.nixosModules.darwin + ({...}: { + my = { username = "yuanwang"; name = "Yuan Wang"; email = "yuan.wang@workiva.com"; @@ -14,6 +13,10 @@ gpgKey = "19AD3F6B1A5BF3BF"; homeDirectory = "/Users/yuanwang"; }; + + }) + ]; + home-manager.users.${config.my.username}.programs = { go = { enable = true; From 5e031b5b5eff2ee0ef3eba4090f45a6819363612 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:41:12 -0600 Subject: [PATCH 04/36] hide this for now --- hosts/wk01174.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hosts/wk01174.nix b/hosts/wk01174.nix index cdec18cc..400cba78 100644 --- a/hosts/wk01174.nix +++ b/hosts/wk01174.nix @@ -12,18 +12,18 @@ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; - home-manager.users.${config.my.username}.programs = { - go = { - enable = true; - goPath = "go"; - }; - git = { - extraConfig = { - github.user = "yuanwang-wf"; - # url."git@github.com:".insteadOf = "https://github.com"; - }; - }; - }; + # home-manager.users.${config.my.username}.programs = { + # go = { + # enable = true; + # goPath = "go"; + # }; + # git = { + # extraConfig = { + # github.user = "yuanwang-wf"; + # # url."git@github.com:".insteadOf = "https://github.com"; + # }; + # }; + # }; modules = { # common = { # enable = true; From ffb2f7f9cb4743be1fd2f211cd1d0436c2d0ce6d Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:46:04 -0600 Subject: [PATCH 05/36] add this --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 7fd774be..468e7226 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,7 @@ ]; imports = [ ./devshell.nix - # ./packages + ./user.nix ./hosts ./modules # ./systemModule.nix From 270aeb0a57b190ee4f60e3f0974c52e80c767c2e Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:46:43 -0600 Subject: [PATCH 06/36] how is this --- hosts/wk01174.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hosts/wk01174.nix b/hosts/wk01174.nix index 400cba78..cdec18cc 100644 --- a/hosts/wk01174.nix +++ b/hosts/wk01174.nix @@ -12,18 +12,18 @@ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; - # home-manager.users.${config.my.username}.programs = { - # go = { - # enable = true; - # goPath = "go"; - # }; - # git = { - # extraConfig = { - # github.user = "yuanwang-wf"; - # # url."git@github.com:".insteadOf = "https://github.com"; - # }; - # }; - # }; + home-manager.users.${config.my.username}.programs = { + go = { + enable = true; + goPath = "go"; + }; + git = { + extraConfig = { + github.user = "yuanwang-wf"; + # url."git@github.com:".insteadOf = "https://github.com"; + }; + }; + }; modules = { # common = { # enable = true; From 2199b2c2e50c7eff55269512f6c814cf5fa90a62 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:47:14 -0600 Subject: [PATCH 07/36] how is this --- modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default.nix b/modules/default.nix index 9b7c2eea..0f66f88b 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -17,7 +17,7 @@ ./helix.nix ./neovim ./health.nix - ./settings.nix + # ./settings.nix ./terminal ./typing ./workShell.nix From 4f6f533dd63ad96cc17955ecfc68d68b092a678d Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:47:31 -0600 Subject: [PATCH 08/36] add user.nic --- user.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 user.nix diff --git a/user.nix b/user.nix new file mode 100644 index 00000000..fbfdee05 --- /dev/null +++ b/user.nix @@ -0,0 +1,28 @@ +{ lib, options, ... }: +with lib; + +let + mkOptStr = value: + mkOption { + type = with types; uniq str; + default = value; + }; + + # copied from https://github.com/cmacrae/config + mailAddr = name: domain: "${name}@${domain}"; +in +{ + # https://github.com/ahmedelgabri/dotfiles/blob/16bc31166025ed450654ae5be08e840525d4c02f/nix/modules/shared/settings.nix#L38 + # https://github.com/hlissner/dotfiles/blob/089f1a9da9018df9e5fc200c2d7bef70f4546026/modules/options.nix#L39 + options = with types; { + my = { + username = mkOptStr "yuanwang"; + name = mkOptStr "Yuan Wang"; + email = mkOptStr (mailAddr "me" "yuanwang.ca"); + hostname = mkOptStr "yuan-mac"; + gpgKey = mkOptStr "BF2ADAA2A98F45E7"; + homeDirectory = mkOptStr "/Users/yuanwang"; + font = mkOptStr "PragmataPro"; + }; + }; +} From 5eb9f852232441f11834b3e53f1c65511afff6d7 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:50:48 -0600 Subject: [PATCH 09/36] what --- hosts/wf17084.nix | 20 ++++++++++---------- modules/default.nix | 2 +- modules/settings.nix | 11 +++++++++++ 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 8084b387..c2d03bb2 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -4,17 +4,17 @@ imports = [ inputs.self.nixosModules.common inputs.self.nixosModules.darwin - ({...}: { - my = { - username = "yuanwang"; - name = "Yuan Wang"; - email = "yuan.wang@workiva.com"; - hostname = "wf17084"; - gpgKey = "19AD3F6B1A5BF3BF"; - homeDirectory = "/Users/yuanwang"; - }; + # ({...}: { + # my = { + # username = "yuanwang"; + # name = "Yuan Wang"; + # email = "yuan.wang@workiva.com"; + # hostname = "wf17084"; + # gpgKey = "19AD3F6B1A5BF3BF"; + # homeDirectory = "/Users/yuanwang"; + # }; - }) + # }) ]; home-manager.users.${config.my.username}.programs = { diff --git a/modules/default.nix b/modules/default.nix index 0f66f88b..9b7c2eea 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -17,7 +17,7 @@ ./helix.nix ./neovim ./health.nix - # ./settings.nix + ./settings.nix ./terminal ./typing ./workShell.nix diff --git a/modules/settings.nix b/modules/settings.nix index 849f50e5..d4fb262f 100644 --- a/modules/settings.nix +++ b/modules/settings.nix @@ -26,4 +26,15 @@ in font = mkOptStr "PragmataPro"; }; }; + config = { + my = { + username = "yuanwang"; + name = "Yuan Wang"; + email = "yuan.wang@workiva.com"; + hostname = "wf17084"; + gpgKey = "19AD3F6B1A5BF3BF"; + homeDirectory = "/Users/yuanwang"; + }; + + }; } From d22338e9ca955aec302c726d67dfc933429d4f0f Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:51:09 -0600 Subject: [PATCH 10/36] what --- hosts/wf17084.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index c2d03bb2..8995f09d 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -17,18 +17,18 @@ # }) ]; - home-manager.users.${config.my.username}.programs = { - go = { - enable = true; - goPath = "go"; - }; - git = { - extraConfig = { - github.user = "yuanwang-wf"; - # url."git@github.com:".insteadOf = "https://github.com"; - }; - }; - }; + # home-manager.users.${config.my.username}.programs = { + # go = { + # enable = true; + # goPath = "go"; + # }; + # git = { + # extraConfig = { + # github.user = "yuanwang-wf"; + # # url."git@github.com:".insteadOf = "https://github.com"; + # }; + # }; + # }; modules = { # common = { # enable = true; From 411e6cb59742ac20fa17c609b03c8930e588bb8f Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:52:07 -0600 Subject: [PATCH 11/36] what --- hosts/wk01174.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/hosts/wk01174.nix b/hosts/wk01174.nix index cdec18cc..ea8cd1d6 100644 --- a/hosts/wk01174.nix +++ b/hosts/wk01174.nix @@ -1,4 +1,20 @@ -{ pkgs, config, ... }: { +{ pkgs, inputs, config, ... }: { + imports = [ + inputs.self.nixosModules.common + inputs.self.nixosModules.darwin + # ({...}: { + # my = { + # username = "yuanwang"; + # name = "Yuan Wang"; + # email = "yuan.wang@workiva.com"; + # hostname = "wf17084"; + # gpgKey = "19AD3F6B1A5BF3BF"; + # homeDirectory = "/Users/yuanwang"; + # }; + + # }) + ]; + my = { username = "yuanwang"; name = "Yuan Wang"; From 07a84b88a169826bd5c2029b42690c65c7d06d5f Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:54:06 -0600 Subject: [PATCH 12/36] =?UTF-8?q?=20=E2=80=A6=20while=20evaluating=20the?= =?UTF-8?q?=20module=20argument=20`flake'=20in=20"/nix/store/l3b7k633dvym9?= =?UTF-8?q?p619y0p182ka1fplzkv-source/macintosh.nix":?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error: infinite recursion encountered --- hosts/wk01174.nix | 14 ++------------ macintosh.nix | 8 ++++---- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/hosts/wk01174.nix b/hosts/wk01174.nix index ea8cd1d6..aa781350 100644 --- a/hosts/wk01174.nix +++ b/hosts/wk01174.nix @@ -1,18 +1,8 @@ { pkgs, inputs, config, ... }: { - imports = [ + + imports = [ inputs.self.nixosModules.common inputs.self.nixosModules.darwin - # ({...}: { - # my = { - # username = "yuanwang"; - # name = "Yuan Wang"; - # email = "yuan.wang@workiva.com"; - # hostname = "wf17084"; - # gpgKey = "19AD3F6B1A5BF3BF"; - # homeDirectory = "/Users/yuanwang"; - # }; - - # }) ]; my = { diff --git a/macintosh.nix b/macintosh.nix index 0e4736a4..afe4c720 100644 --- a/macintosh.nix +++ b/macintosh.nix @@ -1,10 +1,10 @@ -{ flake, config, lib, pkgs, ... }: +{ inputs, config, lib, pkgs, ... }: with pkgs.stdenv; with lib; { imports = [ - flake.inputs.agenix.darwinModules.age - flake.inputs.home-manager.darwinModules.home-manager + inputs.agenix.darwinModules.age + inputs.home-manager.darwinModules.home-manager ]; networking.hostName = config.my.hostname; nix = { @@ -76,7 +76,7 @@ with lib; { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = false; home-manager.users.${config.my.username} = - import ./home.nix { inherit flake pkgs lib config; }; + import ./home.nix { inherit inputs pkgs lib config; }; fonts.fontDir.enable = true; fonts.fonts = with pkgs; [ From e1c17730d1e4ecb1ad61ccb8878c1a3c749fcca5 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 08:55:18 -0600 Subject: [PATCH 13/36] what --- modules/common.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/common.nix b/modules/common.nix index be2cfca8..327f3434 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -1,4 +1,4 @@ -{ flake, config, ... }: +{ inputs, config, ... }: { nix = { # configureBuildUsers = true; @@ -48,12 +48,12 @@ allowUnsupportedSystem = true; }; overlays = [ - flake.inputs.emacs.overlay - flake.inputs.nur.overlay - flake.inputs.agenix.overlays.default + inputs.emacs.overlay + inputs.nur.overlay + inputs.agenix.overlays.default (_final: _prev: { - stable = flake.inputs.nixpkgs-stable.legacyPackages.${_prev.system}; - mesa = flake.inputs.nixpkgs-stable.legacyPackages.${_prev.system}.mesa; + stable = inputs.nixpkgs-stable.legacyPackages.${_prev.system}; + mesa = inputs.nixpkgs-stable.legacyPackages.${_prev.system}.mesa; # use this variant if unfree packages are needed: # unstable = import nixpkgs-unstable { # inherit system; From 3c6b129ed7940bbfb634f5f71518ff563765318b Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 09:01:08 -0600 Subject: [PATCH 14/36] how is this --- flake.nix | 2 +- hosts/wf17084.nix | 20 ++++++++++---------- modules/default.nix | 2 +- modules/settings.nix | 22 +++++++++++----------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index 468e7226..45ac4c83 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,7 @@ ]; imports = [ ./devshell.nix - ./user.nix + # ./user.nix ./hosts ./modules # ./systemModule.nix diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 8995f09d..7a01a6ef 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -4,17 +4,17 @@ imports = [ inputs.self.nixosModules.common inputs.self.nixosModules.darwin - # ({...}: { - # my = { - # username = "yuanwang"; - # name = "Yuan Wang"; - # email = "yuan.wang@workiva.com"; - # hostname = "wf17084"; - # gpgKey = "19AD3F6B1A5BF3BF"; - # homeDirectory = "/Users/yuanwang"; - # }; + ({...}: { + my = { + username = "yuanwang"; + name = "Yuan Wang"; + email = "yuan.wang@workiva.com"; + hostname = "wf17084"; + gpgKey = "19AD3F6B1A5BF3BF"; + homeDirectory = "/Users/yuanwang"; + }; - # }) + }) ]; # home-manager.users.${config.my.username}.programs = { diff --git a/modules/default.nix b/modules/default.nix index 9b7c2eea..c1467090 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -17,7 +17,7 @@ ./helix.nix ./neovim ./health.nix - ./settings.nix + ./settings.nix ./terminal ./typing ./workShell.nix diff --git a/modules/settings.nix b/modules/settings.nix index d4fb262f..6418fec7 100644 --- a/modules/settings.nix +++ b/modules/settings.nix @@ -15,6 +15,7 @@ in { # https://github.com/ahmedelgabri/dotfiles/blob/16bc31166025ed450654ae5be08e840525d4c02f/nix/modules/shared/settings.nix#L38 # https://github.com/hlissner/dotfiles/blob/089f1a9da9018df9e5fc200c2d7bef70f4546026/modules/options.nix#L39 + # Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions. options = with types; { my = { username = mkOptStr "yuanwang"; @@ -26,15 +27,14 @@ in font = mkOptStr "PragmataPro"; }; }; - config = { - my = { - username = "yuanwang"; - name = "Yuan Wang"; - email = "yuan.wang@workiva.com"; - hostname = "wf17084"; - gpgKey = "19AD3F6B1A5BF3BF"; - homeDirectory = "/Users/yuanwang"; - }; - - }; + # config = { + # my = { + # username = "yuanwang"; + # name = "Yuan Wang"; + # email = "yuan.wang@workiva.com"; + # hostname = "wf17084"; + # gpgKey = "19AD3F6B1A5BF3BF"; + # homeDirectory = "/Users/yuanwang"; + # }; + # }; } From b22eb2629bc0f0473a249cd37f366fd2fe5d7348 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 09:02:20 -0600 Subject: [PATCH 15/36] drop flake ref --- modules/neovim/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index f7e5836d..9d041fd9 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -3,7 +3,7 @@ { config , pkgs , lib -, flake +, inputs , ... }: with lib; @@ -106,10 +106,10 @@ in xdg.configFile."nvim".source = pkgs.runCommand "nvim" { } '' mkdir -p $out/parser - ln -s ${flake.inputs.astro-nvim}/* $out/ + ln -s ${inputs.astro-nvim}/* $out/ rm $out/lua mkdir -p $out/lua - ln -s ${flake.inputs.astro-nvim}/lua/* $out/lua + ln -s ${inputs.astro-nvim}/lua/* $out/lua ln -s ${./user} $out/lua/user ${lib.concatMapStringsSep "\n" (name: '' ln -s ${pkgs.tree-sitter.builtGrammars."tree-sitter-${name}"}/parser $out/parser/${name}.so From adb7154c5b11f615f03c2f8eeda105a55b0c3070 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:03:22 -0600 Subject: [PATCH 16/36] does this work --- flake.nix | 2 -- hosts/wf17084.nix | 24 ++++++++++++------------ systemModule.nix | 36 ------------------------------------ user.nix | 28 ---------------------------- 4 files changed, 12 insertions(+), 78 deletions(-) delete mode 100644 systemModule.nix delete mode 100644 user.nix diff --git a/flake.nix b/flake.nix index 45ac4c83..a83020f4 100644 --- a/flake.nix +++ b/flake.nix @@ -47,10 +47,8 @@ ]; imports = [ ./devshell.nix - # ./user.nix ./hosts ./modules - # ./systemModule.nix inputs.nixos-flake.flakeModule inputs.treefmt-nix.flakeModule ]; diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 7a01a6ef..4decfc76 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -17,18 +17,18 @@ }) ]; - # home-manager.users.${config.my.username}.programs = { - # go = { - # enable = true; - # goPath = "go"; - # }; - # git = { - # extraConfig = { - # github.user = "yuanwang-wf"; - # # url."git@github.com:".insteadOf = "https://github.com"; - # }; - # }; - # }; + programs = { + go = { + enable = true; + goPath = "go"; + }; + git = { + extraConfig = { + github.user = "yuanwang-wf"; + # url."git@github.com:".insteadOf = "https://github.com"; + }; + }; + }; modules = { # common = { # enable = true; diff --git a/systemModule.nix b/systemModule.nix deleted file mode 100644 index 5d83c0e8..00000000 --- a/systemModule.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ inputs, config, lib, ... }: -let - nix-colors = inputs.nix-colors; - astro-nvim = inputs.astro-nvim; -in -{ - - config = { - flake = { - nixos-flake.lib = { - mkLinuxSystem = system: mod: - let - isNixOS = true; - isDarwin = false; - in - inputs.nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { inherit nix-colors isNixOS isDarwin astro-nvim; }; - modules = [ mod ]; - }; - - mkMacosSystem = system: mod: - let - isNixOS = true; - isDarwin = false; - - in - inputs.darwin.lib.darwinSystem { - inherit system; - specialArgs = { inherit nix-colors isNixOS isDarwin astro-nvim; }; - modules = [ mod ]; - }; - }; - }; - }; -} diff --git a/user.nix b/user.nix deleted file mode 100644 index fbfdee05..00000000 --- a/user.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib, options, ... }: -with lib; - -let - mkOptStr = value: - mkOption { - type = with types; uniq str; - default = value; - }; - - # copied from https://github.com/cmacrae/config - mailAddr = name: domain: "${name}@${domain}"; -in -{ - # https://github.com/ahmedelgabri/dotfiles/blob/16bc31166025ed450654ae5be08e840525d4c02f/nix/modules/shared/settings.nix#L38 - # https://github.com/hlissner/dotfiles/blob/089f1a9da9018df9e5fc200c2d7bef70f4546026/modules/options.nix#L39 - options = with types; { - my = { - username = mkOptStr "yuanwang"; - name = mkOptStr "Yuan Wang"; - email = mkOptStr (mailAddr "me" "yuanwang.ca"); - hostname = mkOptStr "yuan-mac"; - gpgKey = mkOptStr "BF2ADAA2A98F45E7"; - homeDirectory = mkOptStr "/Users/yuanwang"; - font = mkOptStr "PragmataPro"; - }; - }; -} From f9ab50bb0df696251a32fa06a021d20066dbf980 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:08:31 -0600 Subject: [PATCH 17/36] does this build --- modules/workShell.nix | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/workShell.nix b/modules/workShell.nix index 655ff8fe..a0941917 100644 --- a/modules/workShell.nix +++ b/modules/workShell.nix @@ -6,22 +6,6 @@ in { options.programs.workShell = { enable = mkEnableOption "workivaShell"; }; config = mkIf config.programs.workShell.enable { - home-manager.users.${config.my.username} = { - home.packages = [ - pkgs.kubernetes-helm - pkgs.aws-iam-authenticator - pkgs.clang-tools - # pkgs.antlr4 - - pkgs.haskellPackages.resource-id - pkgs.haskellPackages.ws-access-token - # pkgs.haskellPackages.mono-stretchly - pkgs.csvkit - # pkgs.visidata - pkgs.terraform - pkgs.terraform-ls - # pkgs.podman - ]; programs.zsh = { shellAliases = { bt = "bigskyTest"; }; profileExtra = mkAfter '' @@ -39,6 +23,23 @@ in { export PATH=$PATH:$HOME/go/bin ''; }; - }; + + home-manager.users.${config.my.username} = { + home.packages = [ + pkgs.kubernetes-helm + pkgs.aws-iam-authenticator + pkgs.clang-tools + # pkgs.antlr4 + + pkgs.haskellPackages.resource-id + pkgs.haskellPackages.ws-access-token + # pkgs.haskellPackages.mono-stretchly + pkgs.csvkit + # pkgs.visidata + pkgs.terraform + pkgs.terraform-ls + # pkgs.podman + ]; + }; }; } From 0628287bde32f8e727aadd0804ac82177fcbde8e Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:13:50 -0600 Subject: [PATCH 18/36] how is this --- hosts/wk01174.nix | 3 ++- modules/workShell.nix | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hosts/wk01174.nix b/hosts/wk01174.nix index aa781350..10a43cdc 100644 --- a/hosts/wk01174.nix +++ b/hosts/wk01174.nix @@ -85,6 +85,7 @@ mainWorkspaceDir = "$HOME/workspaces"; }; wm.yabai.enable = true; + + workShell.enable = true; }; - programs = { workShell.enable = true; }; } diff --git a/modules/workShell.nix b/modules/workShell.nix index a0941917..7d3eec0c 100644 --- a/modules/workShell.nix +++ b/modules/workShell.nix @@ -3,9 +3,9 @@ with lib; let homeDir = config.my.homeDirectory; in { - options.programs.workShell = { enable = mkEnableOption "workivaShell"; }; + options.modules.workShell = { enable = mkEnableOption "workivaShell"; }; - config = mkIf config.programs.workShell.enable { + config = mkIf config.modules.workShell.enable { programs.zsh = { shellAliases = { bt = "bigskyTest"; }; profileExtra = mkAfter '' From 9735e673e90b39574ecc6f47c276fd717e582fd8 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:16:03 -0600 Subject: [PATCH 19/36] try a differen things --- modules/workShell.nix | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/workShell.nix b/modules/workShell.nix index 7d3eec0c..02c1e528 100644 --- a/modules/workShell.nix +++ b/modules/workShell.nix @@ -6,23 +6,6 @@ in { options.modules.workShell = { enable = mkEnableOption "workivaShell"; }; config = mkIf config.modules.workShell.enable { - programs.zsh = { - shellAliases = { bt = "bigskyTest"; }; - profileExtra = mkAfter '' - - [[ -s "${homeDir}/.wk/profile" ]] && source "${homeDir}/.wk/profile" - ''; - initExtra = mkAfter '' - # eval "$(pyenv init -)" - # export PYENV_ROOT="${homeDir}/.pyenv" # needed by pipenv - - # function bigskyTest { - # python manage.py test $1 --http-integration --traceback -v 2 - # } - - export PATH=$PATH:$HOME/go/bin - ''; - }; home-manager.users.${config.my.username} = { home.packages = [ @@ -40,6 +23,24 @@ in { pkgs.terraform-ls # pkgs.podman ]; + programs.zsh = { + shellAliases = { bt = "bigskyTest"; }; + profileExtra = mkAfter '' + + [[ -s "${homeDir}/.wk/profile" ]] && source "${homeDir}/.wk/profile" + ''; + initExtra = mkAfter '' + # eval "$(pyenv init -)" + # export PYENV_ROOT="${homeDir}/.pyenv" # needed by pipenv + + # function bigskyTest { + # python manage.py test $1 --http-integration --traceback -v 2 + # } + + export PATH=$PATH:$HOME/go/bin + ''; + }; + }; }; } From 0030b51ecdbe59218d8990fa87d31ef978f98189 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:16:46 -0600 Subject: [PATCH 20/36] clean upCC --- hosts/wf17084.nix | 20 ++++++++++---------- modules/default.nix | 2 +- modules/workShell.nix | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 4decfc76..7b7d2f2e 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -1,18 +1,18 @@ -{ pkgs, inputs, config, ... }: +{ pkgs, inputs, ... }: { imports = [ inputs.self.nixosModules.common inputs.self.nixosModules.darwin - ({...}: { - my = { - username = "yuanwang"; - name = "Yuan Wang"; - email = "yuan.wang@workiva.com"; - hostname = "wf17084"; - gpgKey = "19AD3F6B1A5BF3BF"; - homeDirectory = "/Users/yuanwang"; - }; + ({ ... }: { + my = { + username = "yuanwang"; + name = "Yuan Wang"; + email = "yuan.wang@workiva.com"; + hostname = "wf17084"; + gpgKey = "19AD3F6B1A5BF3BF"; + homeDirectory = "/Users/yuanwang"; + }; }) ]; diff --git a/modules/default.nix b/modules/default.nix index c1467090..9b7c2eea 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -17,7 +17,7 @@ ./helix.nix ./neovim ./health.nix - ./settings.nix + ./settings.nix ./terminal ./typing ./workShell.nix diff --git a/modules/workShell.nix b/modules/workShell.nix index 02c1e528..22d37046 100644 --- a/modules/workShell.nix +++ b/modules/workShell.nix @@ -23,7 +23,7 @@ in { pkgs.terraform-ls # pkgs.podman ]; - programs.zsh = { + programs.zsh = { shellAliases = { bt = "bigskyTest"; }; profileExtra = mkAfter '' @@ -41,6 +41,6 @@ in { ''; }; - }; + }; }; } From b0da8aa373da983a7ac7856f79b9b6ffc8307c79 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:34:15 -0600 Subject: [PATCH 21/36] wip --- modules/settings.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/settings.nix b/modules/settings.nix index 6418fec7..a5343ecc 100644 --- a/modules/settings.nix +++ b/modules/settings.nix @@ -3,6 +3,8 @@ with lib; let + mkOpt' = type: default: description: + mkOption { inherit type default description; }; mkOptStr = value: mkOption { type = with types; uniq str; @@ -25,6 +27,15 @@ in gpgKey = mkOptStr "BF2ADAA2A98F45E7"; homeDirectory = mkOptStr "/Users/yuanwang"; font = mkOptStr "PragmataPro"; + hm = { + file = mkOpt' attrs { } "Files to place directly in $HOME"; + cacheHome = mkOpt' path "${home}/.cache" "Absolute path to directory holding application caches."; + configFile = mkOpt' attrs { } "Files to place in $XDG_CONFIG_HOME"; + configHome = mkOpt' path "${home}/.config" "Absolute path to directory holding application configurations."; + dataFile = mkOpt' attrs { } "Files to place in $XDG_DATA_HOME"; + dataHome = mkOpt' path "${home}/.local/share" "Absolute path to directory holding application data."; + stateHome = mkOpt' path "${home}/.local/state" "Absolute path to directory holding application states."; + }; }; }; # config = { From a9d73e43bde30633071c504b64173b17c31e3b19 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Wed, 2 Aug 2023 12:39:14 -0600 Subject: [PATCH 22/36] extend things --- modules/settings.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/settings.nix b/modules/settings.nix index a5343ecc..3239aad7 100644 --- a/modules/settings.nix +++ b/modules/settings.nix @@ -26,8 +26,13 @@ in hostname = mkOptStr "yuan-mac"; gpgKey = mkOptStr "BF2ADAA2A98F45E7"; homeDirectory = mkOptStr "/Users/yuanwang"; + packages = mkOption { + type = types.listOf types.package; + default = [ ]; + description = "The set of packages to appear in the user environment."; + }; font = mkOptStr "PragmataPro"; - hm = { + hm = { file = mkOpt' attrs { } "Files to place directly in $HOME"; cacheHome = mkOpt' path "${home}/.cache" "Absolute path to directory holding application caches."; configFile = mkOpt' attrs { } "Files to place in $XDG_CONFIG_HOME"; From 8e64357076a9b234c0ac945534fb4ac42533e119 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:25:03 -0600 Subject: [PATCH 23/36] add more setting --- modules/settings.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/settings.nix b/modules/settings.nix index 3239aad7..fbb1f97c 100644 --- a/modules/settings.nix +++ b/modules/settings.nix @@ -17,9 +17,21 @@ in { # https://github.com/ahmedelgabri/dotfiles/blob/16bc31166025ed450654ae5be08e840525d4c02f/nix/modules/shared/settings.nix#L38 # https://github.com/hlissner/dotfiles/blob/089f1a9da9018df9e5fc200c2d7bef70f4546026/modules/options.nix#L39 + # https://codeberg.org/adamcstephens/profile-parts/src/branch/main/parts/nixos.nix # Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions. options = with types; { my = { + system = lib.mkOption { + type = lib.types.enum [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + description = "The system used when defining the host"; + default = "aarch64-darwin"; + }; + username = mkOptStr "yuanwang"; name = mkOptStr "Yuan Wang"; email = mkOptStr (mailAddr "me" "yuanwang.ca"); From 8ab57bb20753c4dcb11fa3b75298a5bfb73b9175 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:27:39 -0600 Subject: [PATCH 24/36] fmt --- modules/settings.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/settings.nix b/modules/settings.nix index fbb1f97c..362a1251 100644 --- a/modules/settings.nix +++ b/modules/settings.nix @@ -21,16 +21,16 @@ in # Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions. options = with types; { my = { - system = lib.mkOption { - type = lib.types.enum [ - "aarch64-darwin" - "aarch64-linux" - "x86_64-darwin" - "x86_64-linux" - ]; - description = "The system used when defining the host"; - default = "aarch64-darwin"; - }; + system = lib.mkOption { + type = lib.types.enum [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + description = "The system used when defining the host"; + default = "aarch64-darwin"; + }; username = mkOptStr "yuanwang"; name = mkOptStr "Yuan Wang"; From 1fc544529fe9f0bb1f95f3fc3ed2fb2d78c222e5 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:31:47 -0600 Subject: [PATCH 25/36] add pre-commit hook --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index a83020f4..0b311ed7 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,9 @@ treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.url = "github:numtide/treefmt-nix"; nixos-flake.url = "github:srid/nixos-flake"; + pre-commit.url = "github:cachix/re-commit-hooks.nix"; + pre-commit.inputs.nixpkgs.follows = "nixpkgs"; + }; @@ -50,6 +53,7 @@ ./hosts ./modules inputs.nixos-flake.flakeModule + inputs.pre-commit.flakeModule inputs.treefmt-nix.flakeModule ]; perSystem.treefmt.imports = [ ./treefmt.nix ]; From cabb0b7e47cb0c0a88d93d1de64cd4dfb63603ca Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:33:55 -0600 Subject: [PATCH 26/36] try this --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 0b311ed7..098d7242 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,7 @@ treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.url = "github:numtide/treefmt-nix"; nixos-flake.url = "github:srid/nixos-flake"; - pre-commit.url = "github:cachix/re-commit-hooks.nix"; + pre-commit.url = "github:cachix/pre-commit-hooks.nix"; pre-commit.inputs.nixpkgs.follows = "nixpkgs"; }; From 718d29ad094a7fb12f12b19f14da537dc249d4b5 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:41:22 -0600 Subject: [PATCH 27/36] try it --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index 098d7242..d4e285b1 100644 --- a/flake.nix +++ b/flake.nix @@ -57,5 +57,7 @@ inputs.treefmt-nix.flakeModule ]; perSystem.treefmt.imports = [ ./treefmt.nix ]; + # https://github.com/cachix/pre-commit-hooks.nix/blame/30d1c34bdbfe3dd0b8fbdde3962180c56cf16f12/flake-module.nix + perSystem.pre-commit.settings.hooks.treefmt.enable = true; }; } From a05ca331a66472c26e33b0d22398923e20c5ef33 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:47:31 -0600 Subject: [PATCH 28/36] add lock --- flake.lock | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index f3080d33..1bd112a8 100644 --- a/flake.lock +++ b/flake.lock @@ -113,6 +113,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -202,6 +218,24 @@ "type": "github" } }, + "flake-utils_5": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -224,6 +258,27 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "pre-commit", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -475,6 +530,22 @@ "type": "github" } }, + "nixpkgs-stable_4": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1690272529, @@ -535,6 +606,30 @@ "type": "github" } }, + "pre-commit": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_5", + "gitignore": "gitignore_2", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_4" + }, + "locked": { + "lastModified": 1691073619, + "narHash": "sha256-18/EyL9QuzwaA1iJZm0Qp6Lk7sh4YftfWIa2Is3UOSE=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "52bf404674068e7f1ad8ee08bb95648be5a4fb19", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": [ @@ -579,7 +674,8 @@ "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_3", "nur": "nur", - "systems": "systems_4", + "pre-commit": "pre-commit", + "systems": "systems_5", "treefmt-nix": "treefmt-nix" } }, @@ -629,6 +725,21 @@ } }, "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", From 1a5d04ab24d87353a6bca176dde135dec8e368b3 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:50:01 -0600 Subject: [PATCH 29/36] clean up --- flake.nix | 2 -- hosts/default.nix | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index d4e285b1..06da05d9 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,6 @@ }; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.url = "github:numtide/treefmt-nix"; - nixos-flake.url = "github:srid/nixos-flake"; pre-commit.url = "github:cachix/pre-commit-hooks.nix"; pre-commit.inputs.nixpkgs.follows = "nixpkgs"; @@ -52,7 +51,6 @@ ./devshell.nix ./hosts ./modules - inputs.nixos-flake.flakeModule inputs.pre-commit.flakeModule inputs.treefmt-nix.flakeModule ]; diff --git a/hosts/default.nix b/hosts/default.nix index 89adbc81..f7591f2c 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -49,13 +49,14 @@ in ./wk01174.nix ]; }; - wf17084 = self.nixos-flake.lib.mkMacosSystem "x86_64-darwin" { - imports = [ - inputs.self.nixosModules.common - inputs.self.nixosModules.darwin + wf17084 = darwinSystem { + system = "x86_64-darwin" ; + modules = [ ./wf17084.nix ]; }; + + }; }; From 91ea270b9137f2f1fa5b98ba084e257f0e5eba27 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:53:21 -0600 Subject: [PATCH 30/36] how is this --- devshell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/devshell.nix b/devshell.nix index 71f14e3a..f69287d0 100644 --- a/devshell.nix +++ b/devshell.nix @@ -7,6 +7,7 @@ # See https://haskell.flake.page/devshell#composing-devshells inputsFrom = [ config.treefmt.build.devShell + config.pre-commit.devShell ]; }; }; From 082f4dff575b117218e23ebb2cba117e920c704f Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 08:54:50 -0600 Subject: [PATCH 31/36] add per commit hook --- .gitignore | 1 + flake.lock | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 79012c55..3899f315 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ terraform.rc .lego/ wireguard-keys AdGuardHome.yaml +/.pre-commit-config.yaml diff --git a/flake.lock b/flake.lock index 1bd112a8..f578e746 100644 --- a/flake.lock +++ b/flake.lock @@ -420,21 +420,6 @@ "type": "github" } }, - "nixos-flake": { - "locked": { - "lastModified": 1690424850, - "narHash": "sha256-pPELqUXbNdZ7nMLPL8A+BSyUsxjxMO3q2Wb7plW/Wf8=", - "owner": "srid", - "repo": "nixos-flake", - "rev": "df6fe273ff64dc29de2c93805045b5348d70bc26", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "nixos-flake", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1678875422, @@ -670,7 +655,6 @@ "hosts": "hosts", "nix-colors": "nix-colors", "nix-darwin": "nix-darwin", - "nixos-flake": "nixos-flake", "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable_3", "nur": "nur", From de71801eecad3040a551e09f46e807b0bd55f59c Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 09:03:45 -0600 Subject: [PATCH 32/36] move files around --- .gitignore | 2 ++ modules/default.nix | 11 +---------- home.nix => modules/home.nix | 0 macintosh.nix => modules/macintosh.nix | 0 nixos_system.nix => modules/nixos_system.nix | 0 5 files changed, 3 insertions(+), 10 deletions(-) rename home.nix => modules/home.nix (100%) rename macintosh.nix => modules/macintosh.nix (100%) rename nixos_system.nix => modules/nixos_system.nix (100%) diff --git a/.gitignore b/.gitignore index 3899f315..782d16d1 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ terraform.rc wireguard-keys AdGuardHome.yaml /.pre-commit-config.yaml + +diff.json diff --git a/modules/default.nix b/modules/default.nix index 9b7c2eea..3ec6bf7e 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -25,16 +25,7 @@ darwin.imports = [ ./brew.nix ./wm/yabai.nix - ../macintosh.nix - # ({ ... }: { - # }) + ./macintosh.nix ]; - - - # desktop = ./desktop.nix; - # gnome = ./gnome.nix; - # gotosocial = ./gotosocial.nix; - # nix-remote-builders = ./nix-remote-builders.nix; - # server = ./server.nix; }; } diff --git a/home.nix b/modules/home.nix similarity index 100% rename from home.nix rename to modules/home.nix diff --git a/macintosh.nix b/modules/macintosh.nix similarity index 100% rename from macintosh.nix rename to modules/macintosh.nix diff --git a/nixos_system.nix b/modules/nixos_system.nix similarity index 100% rename from nixos_system.nix rename to modules/nixos_system.nix From ec84a1576f9dec272372690b120da75a2034a555 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 09:06:18 -0600 Subject: [PATCH 33/36] fix path --- modules/home.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/home.nix b/modules/home.nix index 34d483ee..908d809c 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -5,21 +5,21 @@ home.homeDirectory = config.my.homeDirectory; # https://rycee.gitlab.io/home-manager/release-notes.html#sec-release-22.11 home.stateVersion = "22.11"; - home.packages = (import ./modules/packages.nix { inherit pkgs; }) + home.packages = (import ./packages.nix { inherit pkgs; }) ++ lib.optionals pkgs.stdenvNoCC.isDarwin - (import ./modules/macos_packages.nix { inherit pkgs; }) + (import ./macos_packages.nix { inherit pkgs; }) ++ lib.optionals pkgs.stdenvNoCC.isLinux - (import ./modules/linux_packages.nix { inherit pkgs; }); + (import ./linux_packages.nix { inherit pkgs; }); xdg = { enable = true; configFile = { # "startpage".source = ./startpage; "wallpapers/haskell-red-noise.png".source = - ./pictures/haskell-red-noise.png; + ../pictures/haskell-red-noise.png; "wallpapers/doom.svg".source = ./pictures/doomEmacs.svg; "wallpapers/nix-wallpaper-dracula.png".source = - ./pictures/nix-wallpaper-dracula.png; + ../pictures/nix-wallpaper-dracula.png; }; }; manual.manpages.enable = false; From 6fe0e85a209c86bc059a0ce0f519f51e478f6987 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 09:07:07 -0600 Subject: [PATCH 34/36] miss one --- modules/home.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home.nix b/modules/home.nix index 908d809c..be675b8a 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -17,7 +17,7 @@ # "startpage".source = ./startpage; "wallpapers/haskell-red-noise.png".source = ../pictures/haskell-red-noise.png; - "wallpapers/doom.svg".source = ./pictures/doomEmacs.svg; + "wallpapers/doom.svg".source = ../pictures/doomEmacs.svg; "wallpapers/nix-wallpaper-dracula.png".source = ../pictures/nix-wallpaper-dracula.png; }; From f75831e3606d5bd7770b9a66ae98a7571ae87408 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 09:12:28 -0600 Subject: [PATCH 35/36] fix ci --- hosts/wf17084.nix | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 7b7d2f2e..2c4ad14a 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -1,23 +1,21 @@ -{ pkgs, inputs, ... }: +{ pkgs, inputs, config, ... }: { imports = [ inputs.self.nixosModules.common inputs.self.nixosModules.darwin - ({ ... }: { - my = { - username = "yuanwang"; - name = "Yuan Wang"; - email = "yuan.wang@workiva.com"; - hostname = "wf17084"; - gpgKey = "19AD3F6B1A5BF3BF"; - homeDirectory = "/Users/yuanwang"; - }; - - }) ]; + my = { + username = "yuanwang"; + name = "Yuan Wang"; + email = "yuan.wang@workiva.com"; + hostname = "wf17084"; + gpgKey = "19AD3F6B1A5BF3BF"; + homeDirectory = "/Users/yuanwang"; + }; + - programs = { + home-manager.users.${config.my.username}.programs = { go = { enable = true; goPath = "go"; From 6cf1a1d0b9af1e5553c44863d0169d00e3414b83 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Thu, 3 Aug 2023 10:06:30 -0600 Subject: [PATCH 36/36] fix ci --- hosts/wf17084.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/wf17084.nix b/hosts/wf17084.nix index 2c4ad14a..9032e765 100644 --- a/hosts/wf17084.nix +++ b/hosts/wf17084.nix @@ -84,6 +84,6 @@ mainWorkspaceDir = "$HOME/workiva"; }; wm.yabai.enable = true; + workShell.enable = true; }; - programs = { workShell.enable = true; }; }