From 9d4decff9c6488e9e16a8b799b677b9d832c8f76 Mon Sep 17 00:00:00 2001 From: Xinyang Li Date: Fri, 21 Jul 2023 07:03:59 +0000 Subject: [PATCH] gold: add gold as a standalone home manager config --- flake.lock | 40 ++++++++++++++++++++++++++++++++++--- flake.nix | 13 +++++++++++- home/xin/common/default.nix | 2 +- home/xin/common/fish.nix | 15 ++++++++++++++ home/xin/gold/default.nix | 15 ++++++++++++++ 5 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 home/xin/gold/default.nix diff --git a/flake.lock b/flake.lock index b94fa32..0fbdee4 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,24 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -31,7 +49,7 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "locked": { "lastModified": 1638122382, "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", @@ -69,7 +87,7 @@ "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs" }, "locked": { @@ -88,7 +106,7 @@ }, "nixos-cn": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ] @@ -220,6 +238,7 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "home-manager": "home-manager", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-cn": "nixos-cn", @@ -248,6 +267,21 @@ "repo": "sops-nix", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 6097107..b1343fd 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,8 @@ sops-nix.url = "github:Mic92/sops-nix"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; + + flake-utils.url = "github:numtide/flake-utils"; }; @@ -70,6 +72,7 @@ ]; }; + images.raspite = (mkNixos { system = "aarch64-linux"; modules = [ @@ -83,5 +86,13 @@ } ]; }).config.system.build.sdImage; - }; + } // + (with flake-utils.lib; (eachSystem defaultSystems (system: + let pkgs = import nixpkgs { inherit system; }; in + { + packages = { + homeConfigurations."xin" = import ./home/xin/gold { inherit home-manager pkgs; }; + }; + } + ))); } diff --git a/home/xin/common/default.nix b/home/xin/common/default.nix index 391bf9c..a5da1a2 100644 --- a/home/xin/common/default.nix +++ b/home/xin/common/default.nix @@ -19,4 +19,4 @@ rclone clash ]; -} \ No newline at end of file +} diff --git a/home/xin/common/fish.nix b/home/xin/common/fish.nix index 3502f1d..19950bf 100644 --- a/home/xin/common/fish.nix +++ b/home/xin/common/fish.nix @@ -15,5 +15,20 @@ src = fishPlugins.hydro.src; } ]; + interactiveShellInit = '' + fish_config theme choose 'ayu Dark' + fish_config prompt choose arrow + ${pkgs.nix-your-shell}/bin/nix-your-shell fish | source + function fish_right_prompt + if test -n "$IN_NIX_SHELL" + echo -n "" + else if test $SHLVL -ge 3 + echo -n "<🚀lv$SHLVL>" + end + end + ''; + functions = { + gitignore = "curl -sL https://www.gitignore.io/api/$argv"; + }; }; } diff --git a/home/xin/gold/default.nix b/home/xin/gold/default.nix new file mode 100644 index 0000000..192e11c --- /dev/null +++ b/home/xin/gold/default.nix @@ -0,0 +1,15 @@ +{ pkgs, home-manager, ... }: + home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ + ../common + { + home.username = "xin"; + home.homeDirectory = "/home/xin"; + home.stateVersion = "23.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + } + ]; + }