From 592aac7f044d6b5c43721327e44a1985856ee545 Mon Sep 17 00:00:00 2001 From: yousiki Date: Tue, 19 Mar 2024 23:15:32 +0800 Subject: [PATCH] Cleanup --- nvfetcher.toml | 31 --- nvfetcher/generated.json | 162 -------------- nvfetcher/generated.nix | 98 --------- src/commonModules/flakeModule.nix | 99 --------- src/formatters/flakeModule.nix | 22 -- src/homeModules/catppuccin.nix | 178 ---------------- src/homeModules/common.nix | 15 -- src/homeModules/flakeModule.nix | 8 - src/homeModules/lang/c.nix | 9 - src/homeModules/lang/default.nix | 7 - src/homeModules/lang/latex.nix | 6 - src/homeModules/lang/nix.nix | 7 - src/homeModules/lang/python.nix | 42 ---- src/homeModules/lang/rust.nix | 5 - src/homeModules/shell.nix | 200 ------------------ src/lib/flakeModule.nix | 62 ------ src/nixosConfigurations/flakeModule.nix | 5 - .../hakase/configuration.nix | 45 ---- src/nixosConfigurations/hakase/default.nix | 41 ---- .../hakase/hardware-configuration.nix | 76 ------- src/nixosModules/common.nix | 14 -- src/nixosModules/desktop.nix | 54 ----- src/nixosModules/flakeModule.nix | 8 - src/nixosModules/nvidia.nix | 27 --- src/nixosModules/server.nix | 15 -- 25 files changed, 1236 deletions(-) delete mode 100644 nvfetcher.toml delete mode 100644 nvfetcher/generated.json delete mode 100644 nvfetcher/generated.nix delete mode 100644 src/commonModules/flakeModule.nix delete mode 100644 src/formatters/flakeModule.nix delete mode 100644 src/homeModules/catppuccin.nix delete mode 100644 src/homeModules/common.nix delete mode 100644 src/homeModules/flakeModule.nix delete mode 100644 src/homeModules/lang/c.nix delete mode 100644 src/homeModules/lang/default.nix delete mode 100644 src/homeModules/lang/latex.nix delete mode 100644 src/homeModules/lang/nix.nix delete mode 100644 src/homeModules/lang/python.nix delete mode 100644 src/homeModules/lang/rust.nix delete mode 100644 src/homeModules/shell.nix delete mode 100644 src/lib/flakeModule.nix delete mode 100644 src/nixosConfigurations/flakeModule.nix delete mode 100644 src/nixosConfigurations/hakase/configuration.nix delete mode 100644 src/nixosConfigurations/hakase/default.nix delete mode 100644 src/nixosConfigurations/hakase/hardware-configuration.nix delete mode 100644 src/nixosModules/common.nix delete mode 100644 src/nixosModules/desktop.nix delete mode 100644 src/nixosModules/flakeModule.nix delete mode 100644 src/nixosModules/nvidia.nix delete mode 100644 src/nixosModules/server.nix diff --git a/nvfetcher.toml b/nvfetcher.toml deleted file mode 100644 index e61c4ba..0000000 --- a/nvfetcher.toml +++ /dev/null @@ -1,31 +0,0 @@ -[lporg] -src.github = "blacktop/lporg" -fetch.github = "blacktop/lporg" - -[clash-meta] -src.github = "MetaCubeX/mihomo" -fetch.github = "MetaCubeX/mihomo" - -[rime-ice] -src.git = "https://github.com/iDvel/rime-ice" -fetch.github = "iDvel/rime-ice" - -[catppuccin-bat] -src.git = "https://github.com/catppuccin/bat" -fetch.github = "catppuccin/bat" - -[catppuccin-bottom] -src.git = "https://github.com/catppuccin/bottom" -fetch.github = "catppuccin/bottom" - -[catppuccin-btop] -src.git = "https://github.com/catppuccin/btop" -fetch.github = "catppuccin/btop" - -[catppuccin-gitui] -src.git = "https://github.com/catppuccin/gitui" -fetch.github = "catppuccin/gitui" - -[catppuccin-starship] -src.git = "https://github.com/catppuccin/starship" -fetch.github = "catppuccin/starship" diff --git a/nvfetcher/generated.json b/nvfetcher/generated.json deleted file mode 100644 index 6d649d1..0000000 --- a/nvfetcher/generated.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "catppuccin-bat": { - "cargoLocks": null, - "date": "2024-03-14", - "extract": null, - "name": "catppuccin-bat", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "catppuccin", - "repo": "bat", - "rev": "b19bea35a85a32294ac4732cad5b0dc6495bed32", - "sha256": "sha256-POoW2sEM6jiymbb+W/9DKIjDM1Buu1HAmrNP0yC2JPg=", - "type": "github" - }, - "version": "b19bea35a85a32294ac4732cad5b0dc6495bed32" - }, - "catppuccin-bottom": { - "cargoLocks": null, - "date": "2022-12-30", - "extract": null, - "name": "catppuccin-bottom", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "catppuccin", - "repo": "bottom", - "rev": "c0efe9025f62f618a407999d89b04a231ba99c92", - "sha256": "sha256-VaHX2I/Gn82wJWzybpWNqU3dPi3206xItOlt0iF6VVQ=", - "type": "github" - }, - "version": "c0efe9025f62f618a407999d89b04a231ba99c92" - }, - "catppuccin-btop": { - "cargoLocks": null, - "date": "2023-10-07", - "extract": null, - "name": "catppuccin-btop", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "catppuccin", - "repo": "btop", - "rev": "c6469190f2ecf25f017d6120bf4e050e6b1d17af", - "sha256": "sha256-jodJl4f2T9ViNqsY9fk8IV62CrpC5hy7WK3aRpu70Cs=", - "type": "github" - }, - "version": "c6469190f2ecf25f017d6120bf4e050e6b1d17af" - }, - "catppuccin-gitui": { - "cargoLocks": null, - "date": "2023-11-13", - "extract": null, - "name": "catppuccin-gitui", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "catppuccin", - "repo": "gitui", - "rev": "39978362b2c88b636cacd55b65d2f05c45a47eb9", - "sha256": "sha256-kWaHQ1+uoasT8zXxOxkur+QgZu1wLsOOrP/TL+6cfII=", - "type": "github" - }, - "version": "39978362b2c88b636cacd55b65d2f05c45a47eb9" - }, - "catppuccin-starship": { - "cargoLocks": null, - "date": "2023-07-13", - "extract": null, - "name": "catppuccin-starship", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "catppuccin", - "repo": "starship", - "rev": "5629d2356f62a9f2f8efad3ff37476c19969bd4f", - "sha256": "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0=", - "type": "github" - }, - "version": "5629d2356f62a9f2f8efad3ff37476c19969bd4f" - }, - "clash-meta": { - "cargoLocks": null, - "date": null, - "extract": null, - "name": "clash-meta", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "MetaCubeX", - "repo": "mihomo", - "rev": "v1.18.1", - "sha256": "sha256-ezOkDrpytZQdc+Txe4eUyuWY6oipn9jIrmu7aO8lNlQ=", - "type": "github" - }, - "version": "v1.18.1" - }, - "lporg": { - "cargoLocks": null, - "date": null, - "extract": null, - "name": "lporg", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "blacktop", - "repo": "lporg", - "rev": "v20.4.31", - "sha256": "sha256-A/OE67qAn9RHSCveiRwG5lPYNTMdrbUWVfQOP3XjkdU=", - "type": "github" - }, - "version": "v20.4.31" - }, - "rime-ice": { - "cargoLocks": null, - "date": "2024-03-18", - "extract": null, - "name": "rime-ice", - "passthru": null, - "pinned": false, - "src": { - "deepClone": false, - "fetchSubmodules": false, - "leaveDotGit": false, - "name": null, - "owner": "iDvel", - "repo": "rime-ice", - "rev": "563ef2645ba995c45ba109dde60f7ac64a7443b9", - "sha256": "sha256-1lxBjVIIIDlz6JGZrRf2ZjCAiEQN9Ru8MSX12tDoGo8=", - "type": "github" - }, - "version": "563ef2645ba995c45ba109dde60f7ac64a7443b9" - } -} \ No newline at end of file diff --git a/nvfetcher/generated.nix b/nvfetcher/generated.nix deleted file mode 100644 index 4c2aca7..0000000 --- a/nvfetcher/generated.nix +++ /dev/null @@ -1,98 +0,0 @@ -# This file was generated by nvfetcher, please do not modify it manually. -{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: -{ - catppuccin-bat = { - pname = "catppuccin-bat"; - version = "b19bea35a85a32294ac4732cad5b0dc6495bed32"; - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "bat"; - rev = "b19bea35a85a32294ac4732cad5b0dc6495bed32"; - fetchSubmodules = false; - sha256 = "sha256-POoW2sEM6jiymbb+W/9DKIjDM1Buu1HAmrNP0yC2JPg="; - }; - date = "2024-03-14"; - }; - catppuccin-bottom = { - pname = "catppuccin-bottom"; - version = "c0efe9025f62f618a407999d89b04a231ba99c92"; - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "bottom"; - rev = "c0efe9025f62f618a407999d89b04a231ba99c92"; - fetchSubmodules = false; - sha256 = "sha256-VaHX2I/Gn82wJWzybpWNqU3dPi3206xItOlt0iF6VVQ="; - }; - date = "2022-12-30"; - }; - catppuccin-btop = { - pname = "catppuccin-btop"; - version = "c6469190f2ecf25f017d6120bf4e050e6b1d17af"; - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "btop"; - rev = "c6469190f2ecf25f017d6120bf4e050e6b1d17af"; - fetchSubmodules = false; - sha256 = "sha256-jodJl4f2T9ViNqsY9fk8IV62CrpC5hy7WK3aRpu70Cs="; - }; - date = "2023-10-07"; - }; - catppuccin-gitui = { - pname = "catppuccin-gitui"; - version = "39978362b2c88b636cacd55b65d2f05c45a47eb9"; - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "gitui"; - rev = "39978362b2c88b636cacd55b65d2f05c45a47eb9"; - fetchSubmodules = false; - sha256 = "sha256-kWaHQ1+uoasT8zXxOxkur+QgZu1wLsOOrP/TL+6cfII="; - }; - date = "2023-11-13"; - }; - catppuccin-starship = { - pname = "catppuccin-starship"; - version = "5629d2356f62a9f2f8efad3ff37476c19969bd4f"; - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "starship"; - rev = "5629d2356f62a9f2f8efad3ff37476c19969bd4f"; - fetchSubmodules = false; - sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0="; - }; - date = "2023-07-13"; - }; - clash-meta = { - pname = "clash-meta"; - version = "v1.18.1"; - src = fetchFromGitHub { - owner = "MetaCubeX"; - repo = "mihomo"; - rev = "v1.18.1"; - fetchSubmodules = false; - sha256 = "sha256-ezOkDrpytZQdc+Txe4eUyuWY6oipn9jIrmu7aO8lNlQ="; - }; - }; - lporg = { - pname = "lporg"; - version = "v20.4.31"; - src = fetchFromGitHub { - owner = "blacktop"; - repo = "lporg"; - rev = "v20.4.31"; - fetchSubmodules = false; - sha256 = "sha256-A/OE67qAn9RHSCveiRwG5lPYNTMdrbUWVfQOP3XjkdU="; - }; - }; - rime-ice = { - pname = "rime-ice"; - version = "563ef2645ba995c45ba109dde60f7ac64a7443b9"; - src = fetchFromGitHub { - owner = "iDvel"; - repo = "rime-ice"; - rev = "563ef2645ba995c45ba109dde60f7ac64a7443b9"; - fetchSubmodules = false; - sha256 = "sha256-1lxBjVIIIDlz6JGZrRf2ZjCAiEQN9Ru8MSX12tDoGo8="; - }; - date = "2024-03-18"; - }; -} diff --git a/src/commonModules/flakeModule.nix b/src/commonModules/flakeModule.nix deleted file mode 100644 index f0669b4..0000000 --- a/src/commonModules/flakeModule.nix +++ /dev/null @@ -1,99 +0,0 @@ -{...}: { - flake.commonModules.default = { - pkgs, - lib, - flake, - flakeInputs, - ... - }: let - inherit (import "${flake}/flake.nix") nixConfig; - in - with lib // builtins; { - # Nixpkgs configuration. - nixpkgs = { - config = { - allowUnfree = true; - }; - overlays = [ - flakeInputs.fenix.overlays.default - flakeInputs.nvfetcher.overlays.default - ]; - }; - - # Basic nix configuration for both NixOS and Darwin. - nix = { - settings = { - # Nix automatically detects files in the store that have identical contents, and replaces them with hard links to a single copy. - auto-optimise-store = true; - # Nix will instruct remote build machines to use their own binary substitutes if available. - builders-use-substitutes = true; - # Experimental nix features. - experimental-features = ["flakes" "nix-command"]; - # Nix will fall back to building from source if a binary substitute fails. - fallback = true; - # The garbage collector will keep the derivations from which non-garbage store paths were built. - keep-derivations = true; - # The garbage collector will keep the outputs of non-garbage derivations. - keep-outputs = true; - # Builds will be performed in a sandboxed environment. - sandbox = pkgs.stdenv.isLinux; - # These users will have additional rights when connecting to the Nix daemon. - trusted-users = ["root" "@wheel" "@admin"]; - # Never warn about dirty Git/Mercurial trees. - warn-dirty = false; - # Substituters and public keys. - inherit (nixConfig) substituters trusted-substituters trusted-public-keys; - }; - - # Garbage collector - gc.automatic = true; - - # List of directories to be searched for <...> file references. - nixPath = [ - "nixpkgs=flake:nixpkgs" - "darwin=/etc/nix/inputs/darwin" - "home-manager=flake:home-manager" - ]; - - registry = - mapAttrs - (n: v: {flake = v;}) - (removeAttrs flakeInputs ["nixpkgs"]); - }; - - environment.systemPackages = with pkgs; [ - alejandra - btop - cachix - curl - du-dust - duf - eza - fd - fzf - gdu - gh - git - helix - home-manager - htop - jq - man - mc - neofetch - nodejs - nvfetcher - ripgrep - rsync - statix - thefuck - tmux - vim - wget - zellij - ]; - - programs.fish.enable = true; - programs.zsh.enable = true; - }; -} diff --git a/src/formatters/flakeModule.nix b/src/formatters/flakeModule.nix deleted file mode 100644 index 23178ff..0000000 --- a/src/formatters/flakeModule.nix +++ /dev/null @@ -1,22 +0,0 @@ -{inputs, ...}: { - imports = [ - inputs.treefmt-nix.flakeModule - ]; - - perSystem = {...}: { - treefmt.config = { - projectRootFile = "flake.nix"; - programs.alejandra.enable = true; - programs.prettier.enable = true; - programs.stylua.enable = true; - settings.formatter = { - alejandra.excludes = [ - "nvfetcher/generated.nix" - ]; - prettier.excludes = [ - "nvfetcher/generated.json" - ]; - }; - }; - }; -} diff --git a/src/homeModules/catppuccin.nix b/src/homeModules/catppuccin.nix deleted file mode 100644 index 43b3b99..0000000 --- a/src/homeModules/catppuccin.nix +++ /dev/null @@ -1,178 +0,0 @@ -{self, ...} @ args: { - pkgs, - lib, - config, - ... -}: -with builtins // lib; let - sources = pkgs.callPackage "${self}/nvfetcher/generated.nix" {}; - - cfg = config.catppuccin; - - flavorAttrs = { - latte = null; - frappe = null; - macchiato = null; - mocha = null; - }; -in { - options.catppuccin = { - enable = mkOption { - type = types.bool; - default = true; - description = '' - Enable catppuccin theme. - ''; - }; - - flavor = mkOption { - type = lib.types.enum [ - "latte" - "frappe" - "macchiato" - "mocha" - ]; - default = "mocha"; - description = '' - The color scheme to use for catppuccin theme. - ''; - }; - }; - - config = mkIf cfg.enable (mkMerge [ - # bat - (mkIf (false && config.programs.bat.enable) { - programs.bat = { - config.theme = "catppuccin-${cfg.flavor}"; - themes = - mapAttrs (n: v: { - src = sources.catppuccin-bat.src; - file = "Catppuccin-${n}.tmTheme"; - }) - flavorAttrs; - }; - }) - - # bottom - (mkIf config.programs.bottom.enable { - programs.bottom = { - settings = fromTOML ( - readFile ( - sources.catppuccin-bottom.src + "/themes/${cfg.flavor}.toml" - ) - ); - }; - }) - - # btop - (mkIf config.programs.btop.enable { - programs.btop.settings.color_scheme = "catppuccin-${cfg.flavor}"; - home.file = - mapAttrs' - (n: v: - nameValuePair - ".config/btop/themes/catppuccin-${n}.theme" - {source = sources.catppuccin-btop.src + "/themes/catppuccin_${n}.theme";}) - flavorAttrs; - }) - - # fzf - (mkIf config.programs.fzf.enable ( - let - catppuccin-colors = { - latte = { - "bg+" = "#ccd0da"; - "bg" = "#eff1f5"; - "spinner" = "#dc8a78"; - "hl" = "#d20f39"; - "fg" = "#4c4f69"; - "header" = "#d20f39"; - "info" = "#8839ef"; - "pointer" = "#dc8a78"; - "marker" = "#dc8a78"; - "fg+" = "#4c4f69"; - "prompt" = "#8839ef"; - "hl+" = "#d20f39"; - }; - frappe = { - "bg+" = "#414559"; - "bg" = "#303446"; - "spinner" = "#f2d5cf"; - "hl" = "#e78284"; - "fg" = "#c6d0f5"; - "header" = "#e78284"; - "info" = "#ca9ee6"; - "pointer" = "#f2d5cf"; - "marker" = "#f2d5cf"; - "fg+" = "#c6d0f5"; - "prompt" = "#ca9ee6"; - "hl+" = "#e78284"; - }; - macchiato = { - "bg+" = "#363a4f"; - "bg" = "#24273a"; - "spinner" = "#f4dbd6"; - "hl" = "#ed8796"; - "fg" = "#cad3f5"; - "header" = "#ed8796"; - "info" = "#c6a0f6"; - "pointer" = "#f4dbd6"; - "marker" = "#f4dbd6"; - "fg+" = "#cad3f5"; - "prompt" = "#c6a0f6"; - "hl+" = "#ed8796"; - }; - mocha = { - "bg+" = "#313244"; - "bg" = "#1e1e2e"; - "spinner" = "#f5e0dc"; - "hl" = "#f38ba8"; - "fg" = "#cdd6f4"; - "header" = "#f38ba8"; - "info" = "#cba6f7"; - "pointer" = "#f5e0dc"; - "marker" = "#f5e0dc"; - "fg+" = "#cdd6f4"; - "prompt" = "#cba6f7"; - "hl+" = "#f38ba8"; - }; - }; - in { - programs.fzf.colors = catppuccin-colors."${cfg.flavor}"; - } - )) - - # gitui - (mkIf config.programs.gitui.enable { - programs.gitui.theme = readFile (sources.catppuccin-gitui.src + "/theme/${cfg.flavor}.ron"); - }) - - # helix - ( - mkIf config.programs.helix.enable { - programs.helix.settings.theme = "catppuccin_${cfg.flavor}"; - } - ) - - # starship - (mkIf config.programs.starship.enable ( - let - loader = n: - fromTOML (readFile ( - sources.catppuccin-starship.src + "/palettes/${n}.toml" - )); - in { - programs.starship.settings = - { - palette = "catppuccin_${cfg.flavor}"; - } - // (loader "${cfg.flavor}"); - } - )) - - # zellij - (mkIf config.programs.zellij.enable { - programs.zellij.settings.theme = "catppuccin-${cfg.flavor}"; - }) - ]); -} diff --git a/src/homeModules/common.nix b/src/homeModules/common.nix deleted file mode 100644 index 79aeb87..0000000 --- a/src/homeModules/common.nix +++ /dev/null @@ -1,15 +0,0 @@ -{...} @ args: { - pkgs, - config, - ... -}: { - # Specify home directory. - home.homeDirectory = pkgs.lib.mkDefault ( - if pkgs.stdenv.isDarwin - then "/Users/${config.home.username}" - else "/home/${config.home.username}" - ); - - # Configure state version. - home.stateVersion = "23.05"; -} diff --git a/src/homeModules/flakeModule.nix b/src/homeModules/flakeModule.nix deleted file mode 100644 index d1343e3..0000000 --- a/src/homeModules/flakeModule.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...} @ args: { - flake.homeModules = { - catppuccin = import ./catppuccin.nix args; - common = import ./common.nix args; - lang = import ./lang args; - shell = import ./shell.nix args; - }; -} diff --git a/src/homeModules/lang/c.nix b/src/homeModules/lang/c.nix deleted file mode 100644 index f99001c..0000000 --- a/src/homeModules/lang/c.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...} @ args: {pkgs, ...}: { - home.packages = with pkgs; [ - clang-tools - cmake - gcc - gnumake - ninja - ]; -} diff --git a/src/homeModules/lang/default.nix b/src/homeModules/lang/default.nix deleted file mode 100644 index 90403c3..0000000 --- a/src/homeModules/lang/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...} @ args: { - c = import ./c.nix args; - latex = import ./latex.nix args; - nix = import ./nix.nix args; - python = import ./python.nix args; - rust = import ./rust.nix args; -} diff --git a/src/homeModules/lang/latex.nix b/src/homeModules/lang/latex.nix deleted file mode 100644 index 48b96bf..0000000 --- a/src/homeModules/lang/latex.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...} @ args: {pkgs, ...}: { - home.packages = with pkgs; [ - tectonic - texlive.combined.scheme-full - ]; -} diff --git a/src/homeModules/lang/nix.nix b/src/homeModules/lang/nix.nix deleted file mode 100644 index c2c071e..0000000 --- a/src/homeModules/lang/nix.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...} @ args: {pkgs, ...}: { - home.packages = with pkgs; [ - alejandra - nil - deadnix - ]; -} diff --git a/src/homeModules/lang/python.nix b/src/homeModules/lang/python.nix deleted file mode 100644 index de4134c..0000000 --- a/src/homeModules/lang/python.nix +++ /dev/null @@ -1,42 +0,0 @@ -{...} @ args: {pkgs, ...}: { - home.packages = with pkgs; [ - black - isort - poetry - python3 - ruff - ruff-lsp - yapf - ]; - - home.file.".condarc".text = '' - channels: - - defaults - changeps1: false - show_channel_urls: true - auto_activate_base: false - default_channels: - - https://mirrors.pku.edu.cn/anaconda/pkgs/main - - https://mirrors.pku.edu.cn/anaconda/pkgs/r - custom_channels: - Paddle: https://mirrors.pku.edu.cn/anaconda/cloud - bioconda: https://mirrors.pku.edu.cn/anaconda/cloud - conda-forge: https://mirrors.pku.edu.cn/anaconda/cloud - intel: https://mirrors.pku.edu.cn/anaconda/cloud - numba: https://mirrors.pku.edu.cn/anaconda/cloud - pytorch3d: https://mirrors.pku.edu.cn/anaconda/cloud - pytorch: https://mirrors.pku.edu.cn/anaconda/cloud - rapidsai: https://mirrors.pku.edu.cn/anaconda/cloud - ''; - - home.file.".config/pip/pip.conf".text = '' - [global] - index-url = https://mirrors.pku.edu.cn/pypi/web/simple - ''; - - programs.zsh.initExtra = '' - if [[ -x "$(command -v conda)" ]]; then - eval "$(conda "shell.$(basename "$SHELL")" hook)" - fi - ''; -} diff --git a/src/homeModules/lang/rust.nix b/src/homeModules/lang/rust.nix deleted file mode 100644 index 111ec4b..0000000 --- a/src/homeModules/lang/rust.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...} @ args: {pkgs, ...}: { - home.packages = with pkgs; [ - fenix.stable.toolchain - ]; -} diff --git a/src/homeModules/shell.nix b/src/homeModules/shell.nix deleted file mode 100644 index 9d0c6b8..0000000 --- a/src/homeModules/shell.nix +++ /dev/null @@ -1,200 +0,0 @@ -{...} @ args: {pkgs, ...}: { - programs = { - # bash - bash = { - enable = true; - enableCompletion = true; - }; - - # bat - bat = { - enable = true; - extraPackages = with pkgs.bat-extras; [ - batdiff - batgrep - batman - batpipe - batwatch - prettybat - ]; - }; - - # bottom - bottom = { - enable = true; - }; - - # btop - btop = { - enable = true; - }; - - # eza (exa) - eza = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - icons = true; - git = true; - }; - - # fzf - fzf = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - tmux.enableShellIntegration = true; - }; - - # gh (github-cli) - gh = { - enable = true; - gitCredentialHelper.enable = true; - extensions = with pkgs; [ - gh-actions-cache - gh-cal - gh-dash - gh-eco - gh-markdown-preview - ]; - }; - - # git - git = { - enable = true; - lfs.enable = true; - delta.enable = true; - userName = "yousiki"; - userEmail = "you.siki@outlook.com"; - extraConfig = { - pull.rebase = false; - push.followTags = true; - }; - }; - - # gitui - gitui = { - enable = true; - }; - - # helix (hx) - helix = { - enable = true; - languages = { - language = - map - (name: { - name = name; - auto-format = true; - }) ["rust" "python" "nix"]; - }; - settings = { - editor = { - line-number = "relative"; - lsp.display-messages = true; - }; - }; - }; - - # mcfly - mcfly = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - fuzzySearchFactor = 3; - }; - - # starship - starship = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - enableIonIntegration = true; - enableNushellIntegration = true; - enableTransience = true; - settings.format = "$all"; - }; - - # tmux - tmux = { - enable = true; - }; - - # zellij - zellij = { - enable = true; - enableBashIntegration = false; - enableZshIntegration = false; - }; - - # zoxide - zoxide = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - enableFishIntegration = true; - enableNushellIntegration = true; - }; - - # zsh - zsh = { - enable = true; - enableCompletion = true; - autocd = true; - autosuggestion.enable = true; - historySubstringSearch.enable = true; - syntaxHighlighting.enable = true; - oh-my-zsh = { - enable = true; - theme = "robbyrussell"; - plugins = [ - "copyfile" - "copypath" - "docker" - "fzf" - "git" - "gitignore" - "history" - "python" - "rust" - "shell-proxy" - "thefuck" - "zoxide" - "zsh-interactive-cd" - ]; - }; - initExtra = '' - bindkey "\e[1;3D" backward-word # ⌥← - bindkey "\e[1;3C" forward-word # ⌥→ - - if [[ -f ~/.orbstack/shell/init.zsh ]]; then - source ~/.orbstack/shell/init.zsh 2>/dev/null || : - fi - ''; - sessionVariables = { - SHELLPROXY_URL = - if pkgs.stdenv.isDarwin - then "http://127.0.0.1:6152" # Surge - else "http://127.0.0.1:7890"; # Clash - SHELLPROXY_NO_PROXY = "localhost,127.0.0.1,edu.cn,yousiki.top"; - }; - }; - }; - - home.file.".ssh/config".text = '' - Include ~/.orbstack/ssh/config - - Host satoshi - HostName satoshi.mck.cn.yousiki.top - User yousiki - Port 22 - - Host hakase - HostName hakase.mck.cn.yousiki.top - User yousiki - Port 22 - ''; -} diff --git a/src/lib/flakeModule.nix b/src/lib/flakeModule.nix deleted file mode 100644 index c2400e5..0000000 --- a/src/lib/flakeModule.nix +++ /dev/null @@ -1,62 +0,0 @@ -# Adapted from https://github.com/srid/nixos-flake/blob/master/flake-module.nix -{ - self, - inputs, - config, - ... -}: let - specialArgs = rec { - flake = self; - flakeInputs = inputs; - flakeConfig = config; - }; -in { - config = { - flake = { - lib = rec { - inherit specialArgs; - - mkLinuxSystem = mod: - inputs.nixpkgs.lib.nixosSystem { - specialArgs = specialArgs; - modules = [mod]; - }; - - mkMacosSystem = mod: - inputs.nix-darwin.lib.darwinSystem { - specialArgs = specialArgs; - modules = [mod]; - }; - - mkHomeConfiguration = pkgs: mod: - inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = specialArgs; - modules = [mod]; - }; - - mkLinuxHomeModule = { - imports = [ - inputs.home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = specialArgs; - } - ]; - }; - - mkDarwinHomeModule = { - imports = [ - inputs.home-manager.darwinModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = specialArgs; - } - ]; - }; - }; - }; - }; -} diff --git a/src/nixosConfigurations/flakeModule.nix b/src/nixosConfigurations/flakeModule.nix deleted file mode 100644 index 11b4453..0000000 --- a/src/nixosConfigurations/flakeModule.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...} @ args: { - flake.nixosConfigurations = { - hakase = import ./hakase/default.nix args; - }; -} diff --git a/src/nixosConfigurations/hakase/configuration.nix b/src/nixosConfigurations/hakase/configuration.nix deleted file mode 100644 index f1764e2..0000000 --- a/src/nixosConfigurations/hakase/configuration.nix +++ /dev/null @@ -1,45 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ - config, - lib, - pkgs, - ... -}: { - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Linux kernel. - boot.kernelPackages = pkgs.linuxPackages_latest; - - # Hostname. - networking.hostName = "hakase"; - - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - time.timeZone = "Asia/Shanghai"; - - # Configure network proxy if necessary - networking.proxy.default = "http://yousiki:yangsiqi@satoshi.mck.cn.yousiki.top:7890"; - networking.proxy.noProxy = "127.0.0.1,localhost,cn.yousiki.top,edu.cn"; - - users.users.yousiki = { - isNormalUser = true; - extraGroups = ["wheel" "docker"]; # Enable ‘sudo’ for the user. - shell = pkgs.zsh; - }; - - programs.zsh.enable = true; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.openssh.openFirewall = true; - - # Enable the firewall. - networking.firewall.enable = true; -} diff --git a/src/nixosConfigurations/hakase/default.nix b/src/nixosConfigurations/hakase/default.nix deleted file mode 100644 index 943f22f..0000000 --- a/src/nixosConfigurations/hakase/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - self, - inputs, - ... -}: -self.lib.mkLinuxSystem { - nixpkgs.hostPlatform = "x86_64-linux"; - - imports = [ - ./configuration.nix - ./hardware-configuration.nix - - inputs.nixos-hardware.nixosModules.common-cpu-intel-cpu-only - inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime - inputs.nixos-hardware.nixosModules.common-pc-hdd - inputs.nixos-hardware.nixosModules.common-pc-ssd - - self.commonModules.default - - self.nixosModules.common - self.nixosModules.desktop - self.nixosModules.nvidia - self.nixosModules.server - - self.lib.mkLinuxHomeModule - { - home-manager.users.yousiki = { - imports = [ - self.homeModules.catppuccin - self.homeModules.common - self.homeModules.lang.c - self.homeModules.lang.latex - self.homeModules.lang.nix - self.homeModules.lang.python - self.homeModules.lang.rust - self.homeModules.shell - ]; - }; - } - ]; -} diff --git a/src/nixosConfigurations/hakase/hardware-configuration.nix b/src/nixosConfigurations/hakase/hardware-configuration.nix deleted file mode 100644 index 92f0e53..0000000 --- a/src/nixosConfigurations/hakase/hardware-configuration.nix +++ /dev/null @@ -1,76 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["vmd" "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - boot.supportedFilesystems = ["bcachefs"]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/d7bb32dc-4599-499c-913e-73660f0cf3c6"; - fsType = "bcachefs"; - options = ["noatime"]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/5764-78C1"; - fsType = "vfat"; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/d1772975-d75b-4efa-aed1-3cb602761b56";} - {device = "/dev/disk/by-uuid/9dc3e2ac-b63d-4dda-8b4c-7be566aa349a";} - ]; - - # Mount multiple-device bcachefs. - systemd.services.mount-data-volume = let - devices = [ - "dev-nvme0n1p3.device" - "dev-sda1.device" - "dev-sdb1.device" - ]; - device = "/dev/nvme0n1p3:/dev/sda1:/dev/sdb1"; - target = "/mnt/data"; - options = "noatime"; - in { - description = "Mount bcachefs volume ${target}"; - bindsTo = devices; - after = devices ++ ["local-fs-pre.target"]; - before = ["umount.target" "local-fs.target"]; - conflicts = ["umount.target"]; - wantedBy = ["local-fs.target"]; - unitConfig = { - RequiresMountsFor = target; - DefaultDependencies = false; - }; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - ExecStart = "${pkgs.util-linux}/bin/mount -t bcachefs -o ${options} ${device} ${target}"; - ExecStop = "${pkgs.util-linux}/umount ${target}"; - }; - }; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/src/nixosModules/common.nix b/src/nixosModules/common.nix deleted file mode 100644 index 2353d70..0000000 --- a/src/nixosModules/common.nix +++ /dev/null @@ -1,14 +0,0 @@ -{...} @ args: {...}: { - # Enable podman. - virtualisation.podman = { - enable = true; - autoPrune.enable = true; - dockerSocket.enable = true; - }; - - # Enable the firewall. - networking.firewall.enable = true; - - # Configure state version. - system.stateVersion = "24.05"; -} diff --git a/src/nixosModules/desktop.nix b/src/nixosModules/desktop.nix deleted file mode 100644 index 518209e..0000000 --- a/src/nixosModules/desktop.nix +++ /dev/null @@ -1,54 +0,0 @@ -{...} @ args: {pkgs, ...}: { - services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; - - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - - environment.systemPackages = with pkgs; [ - _1password-gui - brave - clapper - cloudflare-warp - discord - dolphin - dragon - firefox - google-chrome - handbrake - haruna - kitty - motrix - mpv - qbittorrent - qq - spotify - steam - vlc - vscode - wezterm - zotero - ]; - - fonts.fontDir.enable = true; - fonts.packages = with pkgs; [ - lxgw-neoxihei - lxgw-wenkai - nerdfonts - noto-fonts-cjk - noto-fonts-cjk-sans - noto-fonts-cjk-serif - source-han-mono - source-han-sans - source-han-serif - wqy_microhei - wqy_zenhei - ]; -} diff --git a/src/nixosModules/flakeModule.nix b/src/nixosModules/flakeModule.nix deleted file mode 100644 index 8c4f2ff..0000000 --- a/src/nixosModules/flakeModule.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...} @ args: { - flake.nixosModules = { - common = import ./common.nix args; - desktop = import ./desktop.nix args; - nvidia = import ./nvidia.nix args; - server = import ./server.nix args; - }; -} diff --git a/src/nixosModules/nvidia.nix b/src/nixosModules/nvidia.nix deleted file mode 100644 index 29f470a..0000000 --- a/src/nixosModules/nvidia.nix +++ /dev/null @@ -1,27 +0,0 @@ -{...} @ args: {...}: { - services.xserver.videoDrivers = ["nvidia"]; - - hardware = { - nvidia = { - modesetting.enable = true; - nvidiaSettings = true; - open = false; - }; - - opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - }; - - nixpkgs.config = { - allowUnfree = true; - cudaSupport = true; - }; - - virtualisation = { - containers.cdi.dynamic.nvidia.enable = true; - docker.enableNvidia = true; - }; -} diff --git a/src/nixosModules/server.nix b/src/nixosModules/server.nix deleted file mode 100644 index 322b994..0000000 --- a/src/nixosModules/server.nix +++ /dev/null @@ -1,15 +0,0 @@ -{inputs, ...} @ args: {...}: { - imports = [ - inputs.nixos-vscode-server.nixosModules.default - ]; - - # Fix vscode server issue. - services.vscode-server.enable = true; - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.openssh.openFirewall = true; - - # Enable the firewall. - networking.firewall.enable = true; -}