home-manager: use catppuccin flake to manage themes

This commit is contained in:
xinyangli 2024-06-11 18:02:55 +08:00
parent d2013a50d4
commit 59fe4dcbc2
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
6 changed files with 110 additions and 130 deletions

View file

@ -1,5 +1,20 @@
{ {
"nodes": { "nodes": {
"catppuccin": {
"locked": {
"lastModified": 1717070887,
"narHash": "sha256-ZTEMINFqQL+m55kmoDYIKf3i2NGitSkjBnnLu99ezh0=",
"owner": "catppuccin",
"repo": "nix",
"rev": "2c7661c9fa26a920b8088300ef87d14179c71a27",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nix",
"type": "github"
}
},
"colmena": { "colmena": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -14,11 +29,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1706509311, "lastModified": 1711386353,
"narHash": "sha256-QQKQ6r3CID8aXn2ZXZ79ZJxdCOeVP+JTnOctDALErOw=", "narHash": "sha256-gWEpb8Hybnoqb4O4tmpohGZk6+aerAbJpywKcFIiMlg=",
"owner": "zhaofengli", "owner": "zhaofengli",
"repo": "colmena", "repo": "colmena",
"rev": "c84ccd0a7a712475e861c2b111574472b1a8d0cd", "rev": "cd65ef7a25cdc75052fbd04b120aeb066c3881db",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -46,11 +61,11 @@
"flake-compat_2": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1673956053, "lastModified": 1696426674,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -64,11 +79,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1709126324, "lastModified": 1710146030,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -84,11 +99,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709764752, "lastModified": 1717052710,
"narHash": "sha256-+lM4J4JoJeiN8V+3WSWndPHj1pJ9Jc1UMikGbXLqCTk=", "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "cf111d1a849ddfc38e9155be029519b0e2329615", "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -104,11 +119,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709708644, "lastModified": 1716772633,
"narHash": "sha256-XAFOkZ6yexsqeJrCXWoHxopq0i+7ZqbwATXomMnGmr4=", "narHash": "sha256-Idcye44UW+EgjbjCoklf2IDF+XrehV6CVYvxR1omst4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "94a1e46434736a40f976a454f8bd3ea2144f349b", "rev": "ff80cb4a11bb87f3ce8459be6f16a25ac86eb2ac",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -128,11 +143,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709773506, "lastModified": 1717032429,
"narHash": "sha256-RK9D2rbN7usqlxogWSBA0EsKDScSF/Uyb8ATntC4juA=", "narHash": "sha256-1+87CE8xOUsJChiq9aNQqWPKoWMuyurW+aXrGbMWH7I=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "a17ea69caec11561e73c985360fb596c25f74131", "rev": "0309d806a5431a46fb7fd81e20d7133ac8b1de55",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -141,36 +156,13 @@
"type": "github" "type": "github"
} }
}, },
"nixos-cn": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1682818384,
"narHash": "sha256-l8jh9BQj6nfjPDYGyrZkZwX1GaOqBX+pBHU+7fFZU3w=",
"owner": "nixos-cn",
"repo": "flakes",
"rev": "2d475ec68cca251ef6c6c69a9224db5c264c5e5b",
"type": "github"
},
"original": {
"owner": "nixos-cn",
"repo": "flakes",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1709410583, "lastModified": 1716987116,
"narHash": "sha256-esOSUoQ7mblwcsSea0K17McZuwAIjoS6dq/4b83+lvw=", "narHash": "sha256-uuEkErFVsFdg2K0cKbNQ9JlFSAm/xYqPr4rbPLI91Y8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "59e37017b9ed31dee303dbbd4531c594df95cfbc", "rev": "8251761f93d6f5b91cee45ac09edb6e382641009",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -182,11 +174,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1709479366, "lastModified": 1716948383,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", "rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -214,11 +206,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1709428628, "lastModified": 1716655032,
"narHash": "sha256-//ZCCnpVai/ShtO2vPjh3AWgo8riXCaret6V9s7Hew4=", "narHash": "sha256-kQ25DAiCGigsNR/Quxm3v+JGXAEXZ8I7RAF4U94bGzE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "66d65cb00b82ffa04ee03347595aa20e41fe3555", "rev": "59a450646ec8ee0397f5fa54a08573e8240eb91f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -230,11 +222,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1709780742, "lastModified": 1717079713,
"narHash": "sha256-mJXQZLSI/zgQ98nHMSdmJ0l0YL3n38FWsdE9OiKPcWk=", "narHash": "sha256-mvTQgi86WwALm6NGi9tvCx92zrNjSr8Mz+nCqbG0ZhE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "3428e6cf4521df6254ff5b8bcf31df84fc1dd0d2", "rev": "1a7bbb238afcada295aabc758941ce82e6b1d292",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -245,12 +237,12 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"catppuccin": "catppuccin",
"colmena": "colmena", "colmena": "colmena",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-vscode-extensions": "nix-vscode-extensions", "nix-vscode-extensions": "nix-vscode-extensions",
"nixos-cn": "nixos-cn",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
@ -266,11 +258,11 @@
"nixpkgs-stable": "nixpkgs-stable_2" "nixpkgs-stable": "nixpkgs-stable_2"
}, },
"locked": { "locked": {
"lastModified": 1709711091, "lastModified": 1716692524,
"narHash": "sha256-L0rSIU9IguTG4YqSj4B/02SyTEz55ACq5t8gXpzteYc=", "narHash": "sha256-sALodaA7Zkp/JD6ehgwc0UCBrSBfB4cX66uFGTsqeFU=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "25dd60fdd08fcacee2567a26ba6b91fe098941dc", "rev": "962797a8d7f15ed7033031731d0bb77244839960",
"type": "github" "type": "github"
}, },
"original": { "original": {

116
flake.nix
View file

@ -15,12 +15,6 @@
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
nixos-cn = {
url = "github:nixos-cn/flakes";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
nur = { nur = {
url = "github:nix-community/NUR"; url = "github:nix-community/NUR";
}; };
@ -49,38 +43,47 @@
url = "github:Mic92/nix-index-database"; url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
catppuccin.url = "github:catppuccin/nix";
}; };
outputs = { self, ... }@inputs: outputs =
with inputs; { self
, home-manager
, nixpkgs
, nixos-hardware
, flake-utils
, nur
, catppuccin
, ... }@inputs:
let let
homeConfigurations = import ./home; sharedHmModules = [
sharedModules = [
self.homeManagerModules
inputs.nix-index-database.hmModules.nix-index inputs.nix-index-database.hmModules.nix-index
catppuccin.homeManagerModules.catppuccin
self.homeManagerModules
]; ];
mkHome = user: host: { config, system, ... }: { mkHome = user: host: { ... }: {
imports = [ imports = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager = { home-manager = {
inherit sharedModules; sharedModules = sharedHmModules;
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };
}; };
home-manager.users.${user} = homeConfigurations.${user}.${host}; home-manager.users.${user} = (import ./home).${user}.${host};
} }
]; ];
}; };
mkHomeConfiguration = user: settings: { mkHomeConfiguration = user: host: {
name = user; name = user;
value = home-manager.lib.homeManagerConfiguration { value = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgs = import nixpkgs { system = "x86_64-linux"; };
modules = [ modules = [
self.homeManagerModules (import ./home).${user}.${host}
] ++ sharedModules; ] ++ sharedHmModules;
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs; inherit inputs;
}; };
@ -92,9 +95,9 @@
modules = [ modules = [
self.nixosModules.default self.nixosModules.default
nur.nixosModules.nur nur.nixosModules.nur
./overlays
] ++ modules; ] ++ modules;
}; };
evalSecrets = import ./eval_secrets.nix;
in in
{ {
nixosModules.default = import ./modules/nixos; nixosModules.default = import ./modules/nixos;
@ -107,12 +110,12 @@
deploymentModule = { deploymentModule = {
deployment.targetUser = "xin"; deployment.targetUser = "xin";
}; };
sharedModules = [ sharedColmenaModules = [
self.nixosModules.default self.nixosModules.default
deploymentModule deploymentModule
]; ];
in in
colmena.lib.makeHive { inputs.colmena.lib.makeHive {
meta = { meta = {
nixpkgs = import nixpkgs { nixpkgs = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
@ -123,34 +126,20 @@
}; };
}; };
massicot = { name, nodes, pkgs, ... }: with inputs; { massicot = { ... }: {
deployment.targetHost = "49.13.13.122"; deployment.targetHost = "49.13.13.122";
deployment.buildOnTarget = true; deployment.buildOnTarget = true;
imports = [ imports = [
{ nixpkgs.system = "aarch64-linux"; } { nixpkgs.system = "aarch64-linux"; }
machines/massicot machines/massicot
] ++ sharedModules; ] ++ sharedColmenaModules;
}; };
sgp-00 = { name, nodes, pkgs, ... }: with inputs; { tok-00 = { ... }: {
imports = [ imports = [
machines/dolomite machines/dolomite
] ++ sharedModules; ] ++ sharedColmenaModules;
nixpkgs.system = "x86_64-linux";
networking.hostName = "sgp-00";
system.stateVersion = "23.11";
deployment = {
targetHost = "video.namely.icu";
buildOnTarget = false;
tags = [ "proxy" ];
};
};
tok-00 = { name, nodes, pkgs, ... }: with inputs; {
imports = [
machines/dolomite
] ++ sharedModules;
nixpkgs.system = "x86_64-linux"; nixpkgs.system = "x86_64-linux";
networking.hostName = "tok-00"; networking.hostName = "tok-00";
system.stateVersion = "23.11"; system.stateVersion = "23.11";
@ -160,6 +149,33 @@
tags = [ "proxy" ]; tags = [ "proxy" ];
}; };
}; };
la-00 = { ... }: {
imports = [
machines/dolomite
] ++ sharedColmenaModules;
nixpkgs.system = "x86_64-linux";
networking.hostName = "la-00";
system.stateVersion = "21.05";
deployment = {
targetHost = "la-00.video.namely.icu";
buildOnTarget = false;
tags = [ "proxy" ];
};
};
raspite = { ... }: {
deployment = {
targetHost = "raspite.local";
buildOnTarget = false;
};
nixpkgs.system = "aarch64-linux";
imports = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
nixos-hardware.nixosModules.raspberry-pi-4
machines/raspite/configuration.nix
] ++ sharedColmenaModules;
};
}; };
nixosConfigurations = { nixosConfigurations = {
@ -169,38 +185,16 @@
nixos-hardware.nixosModules.asus-zephyrus-ga401 nixos-hardware.nixosModules.asus-zephyrus-ga401
machines/calcite/configuration.nix machines/calcite/configuration.nix
(mkHome "xin" "calcite") (mkHome "xin" "calcite")
(./overlays)
];
};
raspite = mkNixos {
system = "aarch64-linux";
modules = [
nixos-hardware.nixosModules.raspberry-pi-4
machines/raspite/configuration.nix
(mkHome "xin" "raspite")
]; ];
}; };
} // self.colmenaHive.nodes; } // self.colmenaHive.nodes;
images.raspite = (mkNixos {
system = "aarch64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
nixos-hardware.nixosModules.raspberry-pi-4
machines/raspite/configuration.nix
{
nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.hostPlatform.system = "aarch64-linux";
nixpkgs.buildPlatform.system = "x86_64-linux";
}
];
}).config.system.build.sdImage;
} // flake-utils.lib.eachDefaultSystem (system: } // flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in let pkgs = nixpkgs.legacyPackages.${system}; in
{ {
devShells = { devShells = {
default = pkgs.mkShell { default = pkgs.mkShell {
packages = with pkgs; [ git colmena sops nix-output-monitor rnix-lsp nvd ]; packages = with pkgs; [ git colmena sops nix-output-monitor nil nvd ];
}; };
}; };
} }

View file

@ -18,6 +18,7 @@ in
args = [ args = [
"attach" "attach"
"-c" "-c"
"alacritty-zellij"
]; ];
}; };
font.size = 10.0; font.size = 10.0;
@ -25,14 +26,7 @@ in
resize_increments = true; resize_increments = true;
dynamic_padding = true; dynamic_padding = true;
}; };
import = [
"${config.xdg.configHome}/alacritty/catppuccin-macchiato.toml"
];
}; };
}; };
xdg.configFile."alacritty/catppuccin-macchiato.toml".source = builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/alacritty/main/catppuccin-macchiato.toml";
sha256 = "sha256:1iq187vg64h4rd15b8fv210liqkbzkh8sw04ykq0hgpx20w3qilv";
};
}; };
} }

View file

@ -36,7 +36,6 @@ in
signByDefault = true; signByDefault = true;
key = cfg.signing.keyFile; key = cfg.signing.keyFile;
}; };
extraConfig.user = mkIf cfg.signing.enable { extraConfig.user = mkIf cfg.signing.enable {
signingkey = cfg.signing.keyFile; signingkey = cfg.signing.keyFile;
}; };

View file

@ -22,11 +22,13 @@ let
llvm-vs-code-extensions.vscode-clangd llvm-vs-code-extensions.vscode-clangd
(ms-vscode.cmake-tools.overrideAttrs (_: { sourceRoot = "extension"; })) (ms-vscode.cmake-tools.overrideAttrs (_: { sourceRoot = "extension"; }))
twxs.cmake twxs.cmake
ms-vscode.cpptools
]; ];
settings = { settings = {
"cmake.configureOnEdit" = false; "cmake.configureOnEdit" = false;
"cmake.showOptionsMovedNotification" = false; "cmake.showOptionsMovedNotification" = false;
"cmake.showNotAllDocumentsSavedQuestion" = false; "cmake.showNotAllDocumentsSavedQuestion" = false;
"C_Cpp.intelliSenseEngine" = "Disabled";
}; };
}; };
pythonPackages = { pythonPackages = {
@ -37,7 +39,7 @@ let
settings = { }; settings = { };
}; };
scalaPackages = { scalaPackages = {
systemPackages = with pkgs; [ ]; systemPackages = with pkgs; [ coursier ];
extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [ extension = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
scala-lang.scala scala-lang.scala
scalameta.metals scalameta.metals
@ -54,7 +56,7 @@ let
"latex-workshop.latex.tools" = [ "latex-workshop.latex.tools" = [
{ "name" = "xelatex"; { "name" = "xelatex";
"command" = "xelatex"; "command" = "xelatex";
"args" = [ "-synctex=1" "-interaction=nonstopmode" "-file-line-error" "-pdf" "%DOCFILE%" ]; "args" = [ "-synctex=1" "-interaction=nonstopmode" "-file-line-error" "%DOCFILE%" ];
} }
{ "name" = "pdflatex"; { "name" = "pdflatex";
"command" = "pdflatex"; "command" = "pdflatex";
@ -104,6 +106,7 @@ in
] ++ zipAttrsWithLanguageOption "systemPackages"); ] ++ zipAttrsWithLanguageOption "systemPackages");
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscode.override { commandLineArgs = "--enable-wayland-ime"; };
enableUpdateCheck = false; enableUpdateCheck = false;
enableExtensionUpdateCheck = false; enableExtensionUpdateCheck = false;
mutableExtensionsDir = false; mutableExtensionsDir = false;
@ -131,7 +134,6 @@ in
catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc
# Rust # Rust
rust-lang.rust-analyzer rust-lang.rust-analyzer
# ]) ++ ;
]) ])
] ++ zipAttrsWithLanguageOption "extension"); ] ++ zipAttrsWithLanguageOption "extension");
userSettings = lib.mkMerge ([ userSettings = lib.mkMerge ([

View file

@ -20,7 +20,6 @@ in
"Ctrl n" "Ctrl n"
]; ];
}; };
theme = "catppuccin-macchiato";
}; };
}; };
}; };