mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-13 16:12:40 +02:00
feat: simplify flake.nix
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
result
|
result
|
||||||
result/
|
result/
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
i3:
|
i3:
|
||||||
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo
|
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo
|
||||||
|
|
||||||
hyprland:
|
hypr:
|
||||||
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo
|
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo
|
||||||
|
|
||||||
debug_i3:
|
i3-debug:
|
||||||
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo --show-trace --verbose
|
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo --show-trace --verbose
|
||||||
|
|
||||||
debug_hyprland:
|
hypr-debug:
|
||||||
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo --show-trace --verbose
|
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo --show-trace --verbose
|
||||||
|
|
||||||
update:
|
update:
|
||||||
@@ -49,11 +49,11 @@ bright:
|
|||||||
darwin-set-proxy:
|
darwin-set-proxy:
|
||||||
sudo python3 scripts/darwin_set_proxy.py
|
sudo python3 scripts/darwin_set_proxy.py
|
||||||
|
|
||||||
darwin: darwin-set-proxy
|
ha: darwin-set-proxy
|
||||||
nix build .#darwinConfigurations.harmonica.system
|
nix build .#darwinConfigurations.harmonica.system
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .
|
./result/sw/bin/darwin-rebuild switch --flake .
|
||||||
|
|
||||||
darwin-debug: darwin-set-proxy
|
ha-debug: darwin-set-proxy
|
||||||
nix build .#darwinConfigurations.harmonica.system --show-trace --verbose
|
nix build .#darwinConfigurations.harmonica.system --show-trace --verbose
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .#harmonica --show-trace --verbose
|
./result/sw/bin/darwin-rebuild switch --flake .#harmonica --show-trace --verbose
|
||||||
|
|
||||||
|
|||||||
@@ -58,17 +58,17 @@ sudo nixos-rebuild switch --flake .
|
|||||||
make i3
|
make i3
|
||||||
|
|
||||||
# or we can deploy with details
|
# or we can deploy with details
|
||||||
make debug_i3
|
make i3-debug
|
||||||
```
|
```
|
||||||
|
|
||||||
For MacOS, use the following commands:
|
For MacOS, use the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# deploy the darwin configuration(harmonicia)
|
# deploy the darwin configuration(harmonicia)
|
||||||
make darwin
|
make ha
|
||||||
|
|
||||||
# deploy with details
|
# deploy with details
|
||||||
make darwin-debug
|
make ha-debug
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install Apps from Flatpak
|
## Install Apps from Flatpak
|
||||||
|
|||||||
Generated
+79
-56
@@ -60,26 +60,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"darwin_2": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs-darwin"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1689516967,
|
|
||||||
"narHash": "sha256-sFAa33wkQHanmij/uhfGduIDK8z4dJAita/rK6u9pvE=",
|
|
||||||
"owner": "lnl7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"rev": "61662a63bfe1726588c1da6b412df86d8ca94d63",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "lnl7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688025799,
|
"lastModified": 1688025799,
|
||||||
@@ -185,16 +165,16 @@
|
|||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689160271,
|
"lastModified": 1689766295,
|
||||||
"narHash": "sha256-mEKF6Wcx+wSF/eos/91A7LxhFLDYhSnQnLpwZF13ntg=",
|
"narHash": "sha256-2OuPIcw2WOUc/zjrH7JZHWe1byuMjqP6Zz7D4qsi10s=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "5e577acf516b80173f695a458c2cc188a4d64560",
|
"rev": "b08b72358ad549fd066e5be0fc3aa4c9df367607",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"ref": "v0.27.0",
|
"ref": "v0.27.2",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -226,11 +206,11 @@
|
|||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689509371,
|
"lastModified": 1690114105,
|
||||||
"narHash": "sha256-ESRIO7E8PfKF5cL2ymdrQrvj8LORET24Wbpl0XMzhog=",
|
"narHash": "sha256-QOY9FXZ4pWjlDPdZKkLNNMHS+ct1+4wu8lrcua7+chw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lib-aggregate",
|
"repo": "lib-aggregate",
|
||||||
"rev": "d75813d1b691b829a5b459bc676e2b1d71d2c15e",
|
"rev": "d923660039d7e793712ba93f633778046f5e6087",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -256,17 +236,38 @@
|
|||||||
"url": "ssh://git@github.com/ryan4yin/nix-secrets.git"
|
"url": "ssh://git@github.com/ryan4yin/nix-secrets.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-darwin"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1690368313,
|
||||||
|
"narHash": "sha256-1MG/pU2riawknpYaTfaynKJPaIKFnQiYTTCFJAjXM5Q=",
|
||||||
|
"owner": "lnl7",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "94212ebe32948471a1aa11baa5c576ce60d54589",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "lnl7",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-eval-jobs": {
|
"nix-eval-jobs": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689318580,
|
"lastModified": 1689903701,
|
||||||
"narHash": "sha256-ccMZzE0Du6I7RtAuDZbERsBZRGnFcwXTAnSQqGd7mOY=",
|
"narHash": "sha256-kW1Rke5wLqw8XHVyiWw7qIKZR911GCsbOg5SkgKH1Uc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-eval-jobs",
|
"repo": "nix-eval-jobs",
|
||||||
"rev": "f88571cfc9132e8f2768aa41d57f5f471941d4b6",
|
"rev": "fcaf7773e3a6713b78dacfd442339a96cfab405f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -298,11 +299,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689558522,
|
"lastModified": 1690133435,
|
||||||
"narHash": "sha256-diNpqSRebzvT3P4fLX+40VWZbf2H2hraJDDdg5NJSj0=",
|
"narHash": "sha256-YNZiefETggroaTLsLJG2M+wpF0pJPwiauKG4q48ddNU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "11c98929963a95ad3830960a9216d00e2f792502",
|
"rev": "b1171de4d362c022130c92d7c8adc4bf2b83d586",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -329,11 +330,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-darwin": {
|
"nixpkgs-darwin": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689503327,
|
"lastModified": 1690298576,
|
||||||
"narHash": "sha256-qVwzYLA8oT2oWNDXO0A3bZHOhoPOihIB9T677+Hor1E=",
|
"narHash": "sha256-RLgIGS04t4Rd0viqsx2e9dGViKB6nVsGmO11EagCWmM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f64b9738da8e86195766147e9752c67fccee006c",
|
"rev": "88f63d511092e95d28e9a7c98534595c53de1048",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -345,11 +346,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689469483,
|
"lastModified": 1690073998,
|
||||||
"narHash": "sha256-2SBhY7rZQ/iNCxe04Eqxlz9YK9KgbaTMBssq3/BgdWY=",
|
"narHash": "sha256-qmK+VMvflwUzQSQl4XVP5kbodYLAKThNzq6mZrOM2Mo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "02fea408f27186f139153e1ae88f8ab2abd9c22c",
|
"rev": "d0545f65611a9625f161d0ff02627bc364e024f6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -360,11 +361,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689534811,
|
"lastModified": 1690179384,
|
||||||
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=",
|
"narHash": "sha256-+arbgqFTAtoeKtepW9wCnA0njCOyoiDFyl0Q0SBSOtE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222",
|
"rev": "b12803b6d90e2e583429bb79b859ca53c348b39a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -382,11 +383,11 @@
|
|||||||
"nixpkgs": "nixpkgs_5"
|
"nixpkgs": "nixpkgs_5"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689585449,
|
"lastModified": 1690384532,
|
||||||
"narHash": "sha256-D6TL+9EbDcGLNmpneuGXnonjNWlS563TOoghU/W/k88=",
|
"narHash": "sha256-Nc9d6GPajVdSj02aBDkAAq93fdLUtRXP9EIfwKn3Uq4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "97941d1936213031ae7ca948ba27aa1bd141a630",
|
"rev": "729cabdcc73e84963751dd65163048e9ff1a1a75",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -413,11 +414,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689503327,
|
"lastModified": 1690271650,
|
||||||
"narHash": "sha256-qVwzYLA8oT2oWNDXO0A3bZHOhoPOihIB9T677+Hor1E=",
|
"narHash": "sha256-qwdsW8DBY1qH+9luliIH7VzgwvL+ZGI3LZWC0LTiDMI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f64b9738da8e86195766147e9752c67fccee006c",
|
"rev": "6dc93f0daec55ee2f441da385aaf143863e3d671",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -445,11 +446,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689534811,
|
"lastModified": 1690179384,
|
||||||
"narHash": "sha256-jnSUdzD/414d94plCyNlvTJJtiTogTep6t7ZgIKIHiE=",
|
"narHash": "sha256-+arbgqFTAtoeKtepW9wCnA0njCOyoiDFyl0Q0SBSOtE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222",
|
"rev": "b12803b6d90e2e583429bb79b859ca53c348b39a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -463,10 +464,10 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"astronvim": "astronvim",
|
"astronvim": "astronvim",
|
||||||
"darwin": "darwin_2",
|
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"mysecrets": "mysecrets",
|
"mysecrets": "mysecrets",
|
||||||
|
"nix-darwin": "nix-darwin",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"nixpkgs-darwin": "nixpkgs-darwin",
|
"nixpkgs-darwin": "nixpkgs-darwin",
|
||||||
@@ -489,15 +490,37 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-wayland",
|
||||||
|
"nix-eval-jobs",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689620039,
|
||||||
|
"narHash": "sha256-BtNwghr05z7k5YMdq+6nbue+nEalvDepuA7qdQMAKoQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "719c2977f958c41fa60a928e2fbc50af14844114",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"wlroots": {
|
"wlroots": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"host": "gitlab.freedesktop.org",
|
"host": "gitlab.freedesktop.org",
|
||||||
"lastModified": 1686753331,
|
"lastModified": 1689611045,
|
||||||
"narHash": "sha256-KovjVFwcuoUO0eu/UiWrnD3+m/K+SHSAVIz4xF9K1XA=",
|
"narHash": "sha256-3RTOlQabkNetQ4O4UzSf57JPco9VGVHhSU1ls5uKBeE=",
|
||||||
"owner": "wlroots",
|
"owner": "wlroots",
|
||||||
"repo": "wlroots",
|
"repo": "wlroots",
|
||||||
"rev": "7e7633abf09b362d0bad9e3fc650fd692369291d",
|
"rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
||||||
# Each item in `inputs` will be passed as a parameter to the `outputs` function after being pulled and built.
|
# Each item in `inputs` will be passed as a parameter to the `outputs` function after being pulled and built.
|
||||||
inputs = {
|
inputs = {
|
||||||
@@ -43,7 +42,7 @@
|
|||||||
|
|
||||||
# for macos
|
# for macos
|
||||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
|
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
|
||||||
darwin = {
|
nix-darwin = {
|
||||||
url = "github:lnl7/nix-darwin";
|
url = "github:lnl7/nix-darwin";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||||
};
|
};
|
||||||
@@ -58,7 +57,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# modern window compositor
|
# modern window compositor
|
||||||
hyprland.url = "github:hyprwm/Hyprland/v0.27.0";
|
hyprland.url = "github:hyprwm/Hyprland/v0.27.2";
|
||||||
# community wayland nixpkgs
|
# community wayland nixpkgs
|
||||||
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||||
|
|
||||||
@@ -72,11 +71,17 @@
|
|||||||
agenix.url = "github:ryantm/agenix/0d8c5325fc81daf00532e3e26c6752f7bcde1143";
|
agenix.url = "github:ryantm/agenix/0d8c5325fc81daf00532e3e26c6752f7bcde1143";
|
||||||
|
|
||||||
# AstroNvim is an aesthetic and feature-rich neovim config.
|
# AstroNvim is an aesthetic and feature-rich neovim config.
|
||||||
astronvim = { url = "github:AstroNvim/AstroNvim/v3.33.3"; flake = false; };
|
astronvim = {
|
||||||
|
url = "github:AstroNvim/AstroNvim/v3.33.3";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# my private secrets, it's a private repository, you need to replace it with your own.
|
# my private secrets, it's a private repository, you need to replace it with your own.
|
||||||
# use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time
|
# use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time
|
||||||
mysecrets = { url = "git+ssh://git@github.com/ryan4yin/nix-secrets.git?shallow=1"; flake = false; };
|
mysecrets = {
|
||||||
|
url = "git+ssh://git@github.com/ryan4yin/nix-secrets.git?shallow=1";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# The `outputs` function will return all the build results of the flake.
|
# The `outputs` function will return all the build results of the flake.
|
||||||
@@ -84,204 +89,138 @@
|
|||||||
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
||||||
# However, `self` is an exception, this special parameter points to the `outputs` itself (self-reference)
|
# However, `self` is an exception, this special parameter points to the `outputs` itself (self-reference)
|
||||||
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
|
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
|
||||||
outputs =
|
outputs = inputs @ {
|
||||||
inputs@{ self
|
self,
|
||||||
, nixpkgs
|
nixpkgs,
|
||||||
, darwin
|
nixpkgs-unstable,
|
||||||
, home-manager
|
nix-darwin,
|
||||||
, nixos-generators
|
home-manager,
|
||||||
, ...
|
nixos-generators,
|
||||||
}:
|
...
|
||||||
|
}: let
|
||||||
let
|
username = "ryan";
|
||||||
x64_system = "x86_64-linux";
|
x64_system = "x86_64-linux";
|
||||||
x64_specialArgs = {
|
x64_darwin = "x86_64-darwin";
|
||||||
|
allSystems = [x64_system x64_darwin];
|
||||||
|
|
||||||
|
nixosSystem = import ./lib/nixosSystem.nix;
|
||||||
|
macosSystem = import ./lib/macosSystem.nix;
|
||||||
|
|
||||||
|
# 星野 アイ, Hoshino Ai
|
||||||
|
idol_ai_modules_i3 = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/ai
|
||||||
|
./modules/nixos/i3.nix
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/desktop-i3.nix;
|
||||||
|
};
|
||||||
|
idol_ai_modules_hyprland = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/ai
|
||||||
|
./modules/nixos/hyprland.nix
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/desktop-hyprland.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
# 星野 愛久愛海, Hoshino Akuamarin
|
||||||
|
idol_aquamarine_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/aquamarine
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
# 星野 瑠美衣, Hoshino Rubii
|
||||||
|
idol_ruby_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/ruby
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
# 有馬 かな, Arima Kana
|
||||||
|
idol_kana_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/kana
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
nixosConfigurations = let
|
||||||
|
system = x64_system;
|
||||||
|
specialArgs =
|
||||||
|
{
|
||||||
|
inherit username;
|
||||||
# use unstable branch for some packages to get the latest updates
|
# use unstable branch for some packages to get the latest updates
|
||||||
pkgs-unstable = import inputs.nixpkgs-unstable {
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
system = x64_system; # refer the `system` parameter form outer scope recursively
|
system = x64_system; # refer the `system` parameter form outer scope recursively
|
||||||
# To use chrome, we need to allow the installation of non-free software
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
} // inputs;
|
|
||||||
# 星野 アイ, Hoshino Ai
|
|
||||||
idol_ai_modules_i3 = [
|
|
||||||
./hosts/idols/ai
|
|
||||||
./modules/nixos/i3.nix
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = x64_specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/desktop-i3.nix;
|
|
||||||
}
|
}
|
||||||
];
|
// inputs;
|
||||||
idol_ai_modules_hyprland = [
|
base_args = {
|
||||||
./hosts/idols/ai
|
inherit home-manager nixos-generators system specialArgs;
|
||||||
./modules/nixos/hyprland.nix
|
};
|
||||||
|
stable_args = base_args // {inherit nixpkgs;};
|
||||||
home-manager.nixosModules.home-manager
|
unstable_args = base_args // {nixpkgs = nixpkgs-unstable;};
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = x64_specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/desktop-hyprland.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
# 星野 愛久愛海, Hoshino Akuamarin
|
|
||||||
idol_aquamarine_modules = [
|
|
||||||
./hosts/idols/aquamarine
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = x64_specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/server.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
# 星野 瑠美衣, Hoshino Rubii
|
|
||||||
idol_ruby_modules = [
|
|
||||||
./hosts/idols/ruby
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = x64_specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/server.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
# 有馬 かな, Arima Kana
|
|
||||||
idol_kana_modules = [
|
|
||||||
./hosts/idols/kana
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = x64_specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/server.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = let system = x64_system; specialArgs = x64_specialArgs; in {
|
# ai with i3 window manager
|
||||||
ai_i3 = nixpkgs.lib.nixosSystem { # ai with i3 window manager
|
ai_i3 = nixosSystem (idol_ai_modules_i3 // stable_args);
|
||||||
inherit system specialArgs;
|
# ai with hyprland compositor
|
||||||
modules = idol_ai_modules_i3;
|
ai_hyprland = nixosSystem (idol_ai_modules_hyprland // stable_args);
|
||||||
};
|
|
||||||
ai_hyprland = nixpkgs.lib.nixosSystem { # ai with hyprland compositor
|
aquamarine = nixosSystem (idol_aquamarine_modules // unstable_args);
|
||||||
inherit system specialArgs;
|
ruby = nixosSystem (idol_ruby_modules // unstable_args);
|
||||||
modules = idol_ai_modules_hyprland;
|
kana = nixosSystem (idol_kana_modules // unstable_args);
|
||||||
};
|
};
|
||||||
|
|
||||||
aquamarine = nixpkgs.lib.nixosSystem {
|
# take images for idols
|
||||||
inherit system specialArgs;
|
# https://github.com/nix-community/nixos-generators
|
||||||
modules = idol_aquamarine_modules;
|
packages."${x64_system}" =
|
||||||
};
|
nixpkgs.lib.genAttrs [
|
||||||
|
"ai_i3"
|
||||||
ruby = nixpkgs.lib.nixosSystem {
|
"ai_hyprland"
|
||||||
inherit system specialArgs;
|
] (
|
||||||
modules = idol_ruby_modules;
|
host:
|
||||||
};
|
self.nixosConfigurations.${host}.config.formats.iso
|
||||||
|
)
|
||||||
kana = nixpkgs.lib.nixosSystem {
|
// nixpkgs.lib.genAttrs [
|
||||||
inherit system specialArgs;
|
"aquamarine"
|
||||||
modules = idol_kana_modules;
|
"ruby"
|
||||||
};
|
"kana"
|
||||||
};
|
] (
|
||||||
|
host:
|
||||||
|
self.nixosConfigurations.${host}.config.formats.proxmox
|
||||||
|
);
|
||||||
|
|
||||||
# macOS's configuration, for work.
|
# macOS's configuration, for work.
|
||||||
darwinConfigurations."harmonica" = let
|
darwinConfigurations."harmonica" = let
|
||||||
system = "x86_64-darwin";
|
system = x64_darwin;
|
||||||
specialArgs = {
|
specialArgs =
|
||||||
|
{
|
||||||
# use unstable branch for some packages to get the latest updates
|
# use unstable branch for some packages to get the latest updates
|
||||||
pkgs-unstable = import inputs.nixpkgs-unstable {
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
inherit system; # refer the `system` parameter form outer scope recursively
|
inherit system; # refer the `system` parameter form outer scope recursively
|
||||||
# To use chrome, we need to allow the installation of non-free software
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
} // inputs;
|
|
||||||
in
|
|
||||||
darwin.lib.darwinSystem {
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = [
|
|
||||||
./hosts/harmonica
|
|
||||||
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/darwin;
|
|
||||||
}
|
}
|
||||||
|
// inputs;
|
||||||
|
in
|
||||||
|
macosSystem {
|
||||||
|
inherit nix-darwin home-manager system specialArgs;
|
||||||
|
darwin-modules = [
|
||||||
|
./hosts/harmonica
|
||||||
];
|
];
|
||||||
|
home-module = import ./home/darwin;
|
||||||
};
|
};
|
||||||
|
|
||||||
formatter = {
|
|
||||||
# format the nix code in this flake
|
# format the nix code in this flake
|
||||||
# alejandra is a nix formatter with a beautiful output
|
# alejandra is a nix formatter with a beautiful output
|
||||||
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
formatter = nixpkgs.lib.genAttrs allSystems (
|
||||||
x86_64-darwin = nixpkgs.legacyPackages.x86_64-darwin.alejandra;
|
system:
|
||||||
};
|
nixpkgs.legacyPackages.${system}.alejandra
|
||||||
|
);
|
||||||
packages.x86_64-linux =
|
|
||||||
# take images for idols
|
|
||||||
# https://github.com/nix-community/nixos-generators
|
|
||||||
let system = x64_system; specialArgs = x64_specialArgs; in {
|
|
||||||
# Hoshino Ai is a physical machine, so we need to generate an iso image for it.
|
|
||||||
ai_i3 = nixos-generators.nixosGenerate { # ai with i3 window manager
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = idol_ai_modules_i3;
|
|
||||||
format = "iso";
|
|
||||||
};
|
|
||||||
ai_hyprland = nixos-generators.nixosGenerate { # ai with hyprland compositor
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = idol_ai_modules_hyprland;
|
|
||||||
format = "iso";
|
|
||||||
};
|
|
||||||
# Hoshino Aquamarine is a virtual machine running on Proxmox VE.
|
|
||||||
aquamarine = nixos-generators.nixosGenerate {
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = idol_aquamarine_modules ++ [
|
|
||||||
({config, ...}: {
|
|
||||||
proxmox.qemuConf.name = "aquamarine-nixos-${config.system.nixos.label}";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
# proxmox's configuration:
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/proxmox-image.nix
|
|
||||||
#
|
|
||||||
# after resize the disk, it will grow partition automatically.
|
|
||||||
# and it alse had qemu-guest-agent installed by default.
|
|
||||||
format = "proxmox";
|
|
||||||
};
|
|
||||||
# Hoshino Rubii is a vm too.
|
|
||||||
ruby = nixos-generators.nixosGenerate {
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = idol_ruby_modules ++ [
|
|
||||||
({config, ...}: {
|
|
||||||
proxmox.qemuConf.name = "ruby-nixos-${config.system.nixos.label}";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
format = "proxmox";
|
|
||||||
};
|
|
||||||
# Kana is a vm too.
|
|
||||||
kana = nixos-generators.nixosGenerate {
|
|
||||||
inherit system specialArgs;
|
|
||||||
modules = idol_kana_modules ++ [
|
|
||||||
({config, ...}: {
|
|
||||||
proxmox.qemuConf.name = "kana-nixos-${config.system.nixos.label}";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
format = "proxmox";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{ lib, stdenvNoCC, fetchgit }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
fetchgit,
|
||||||
|
}:
|
||||||
stdenvNoCC.mkDerivation rec {
|
stdenvNoCC.mkDerivation rec {
|
||||||
pname = "icomoon-feather-font";
|
pname = "icomoon-feather-font";
|
||||||
version = "2023-05-06";
|
version = "2023-05-06";
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{pkgs, ...}:
|
{pkgs, ...}:
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
#
|
#
|
||||||
# Alacritty Configuration
|
# Alacritty Configuration
|
||||||
@@ -18,13 +17,13 @@
|
|||||||
# Note: Alacritty do not have support for Tabs, and any graphic protocol.
|
# Note: Alacritty do not have support for Tabs, and any graphic protocol.
|
||||||
#
|
#
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.alacritty = {
|
programs.alacritty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."alacritty/alacritty.yml".text = ''
|
xdg.configFile."alacritty/alacritty.yml".text =
|
||||||
|
''
|
||||||
import:
|
import:
|
||||||
# all alacritty themes can be found at
|
# all alacritty themes can be found at
|
||||||
# https://github.com/alacritty/alacritty-theme
|
# https://github.com/alacritty/alacritty-theme
|
||||||
@@ -81,17 +80,21 @@
|
|||||||
# If the bold italic family is not specified, it will fall back to the
|
# If the bold italic family is not specified, it will fall back to the
|
||||||
# value specified for the normal font.
|
# value specified for the normal font.
|
||||||
family: JetBrainsMono Nerd Font
|
family: JetBrainsMono Nerd Font
|
||||||
'' + (if pkgs.stdenv.isDarwin then ''
|
''
|
||||||
|
+ (
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then ''
|
||||||
# Point size
|
# Point size
|
||||||
size: 14
|
size: 14
|
||||||
shell: # force nushell as default shell on macOS
|
shell: # force nushell as default shell on macOS
|
||||||
program: /run/current-system/sw/bin/nu
|
program: /run/current-system/sw/bin/nu
|
||||||
'' else ''
|
''
|
||||||
|
else ''
|
||||||
# holder identation
|
# holder identation
|
||||||
# Point size
|
# Point size
|
||||||
size: 13
|
size: 13
|
||||||
'');
|
''
|
||||||
|
);
|
||||||
|
|
||||||
xdg.configFile."alacritty/theme_catppuccino.yml".source = ./theme_catppuccino.yml;
|
xdg.configFile."alacritty/theme_catppuccino.yml".source = ./theme_catppuccino.yml;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ ... }:
|
{...}: {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./alacritty
|
./alacritty
|
||||||
../server
|
../server
|
||||||
@@ -10,5 +9,4 @@
|
|||||||
./media.nix
|
./media.nix
|
||||||
./shell.nix
|
./shell.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{ pkgs, pkgs-unstable, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Basic settings for development environment
|
# Basic settings for development environment
|
||||||
@@ -36,7 +38,8 @@
|
|||||||
gnumake # used by this repo, to simplify the deployment
|
gnumake # used by this repo, to simplify the deployment
|
||||||
|
|
||||||
# python
|
# python
|
||||||
(python311.withPackages (ps: with ps; [
|
(python311.withPackages (ps:
|
||||||
|
with ps; [
|
||||||
ipython
|
ipython
|
||||||
pandas
|
pandas
|
||||||
requests
|
requests
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{ lib, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
###########################################################
|
###########################################################
|
||||||
#
|
#
|
||||||
# Kitty Configuration
|
# Kitty Configuration
|
||||||
@@ -28,18 +31,27 @@
|
|||||||
font = {
|
font = {
|
||||||
name = "JetBrainsMono Nerd Font";
|
name = "JetBrainsMono Nerd Font";
|
||||||
# use different font size on macOS
|
# use different font size on macOS
|
||||||
size = if pkgs.stdenv.isDarwin then 14 else 13;
|
size =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then 14
|
||||||
|
else 13;
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = {
|
settings =
|
||||||
|
{
|
||||||
background_opacity = "0.95";
|
background_opacity = "0.95";
|
||||||
macos_option_as_alt = true; # Option key acts as Alt on macOS
|
macos_option_as_alt = true; # Option key acts as Alt on macOS
|
||||||
scrollback_lines = 10000;
|
scrollback_lines = 10000;
|
||||||
enable_audio_bell = false;
|
enable_audio_bell = false;
|
||||||
} // (if pkgs.stdenv.isDarwin then {
|
}
|
||||||
|
// (
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then {
|
||||||
# macOS specific settings, force kitty to use nushell as default shell
|
# macOS specific settings, force kitty to use nushell as default shell
|
||||||
shell = "/run/current-system/sw/bin/nu";
|
shell = "/run/current-system/sw/bin/nu";
|
||||||
} else {});
|
}
|
||||||
|
else {}
|
||||||
|
);
|
||||||
|
|
||||||
# macOS specific settings
|
# macOS specific settings
|
||||||
darwinLaunchOptions = ["--start-as=fullscreen"];
|
darwinLaunchOptions = ["--start-as=fullscreen"];
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{ pkgs
|
{
|
||||||
, config
|
pkgs,
|
||||||
, ...
|
config,
|
||||||
|
...
|
||||||
}:
|
}:
|
||||||
# processing audio/video
|
# processing audio/video
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{ pkgs, astronvim, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
astronvim,
|
||||||
|
...
|
||||||
|
}:
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# AstroNvim's configuration and all its dependencies
|
# AstroNvim's configuration and all its dependencies
|
||||||
@@ -126,7 +129,6 @@
|
|||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
# search all the plugins using https://search.nixos.org/packages
|
# search all the plugins using https://search.nixos.org/packages
|
||||||
luasnip
|
luasnip
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -215,5 +217,4 @@
|
|||||||
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
{...}: {
|
{...}: {
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
# load the alias file for work
|
# load the alias file for work
|
||||||
@@ -22,5 +21,4 @@
|
|||||||
source /etc/agenix/alias-for-work.nushell
|
source /etc/agenix/alias-for-work.nushell
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ ... }:
|
{...}: {
|
||||||
{
|
|
||||||
# a cat(1) clone with syntax highlighting and Git integration.
|
# a cat(1) clone with syntax highlighting and Git integration.
|
||||||
programs.bat = {
|
programs.bat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -12,6 +11,4 @@
|
|||||||
Catppuccin-mocha = builtins.readFile ./Catppuccin-mocha.tmTheme;
|
Catppuccin-mocha = builtins.readFile ./Catppuccin-mocha.tmTheme;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
neofetch
|
neofetch
|
||||||
nnn # terminal file manager
|
nnn # terminal file manager
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ ... }:
|
{...}: {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./bat
|
./bat
|
||||||
./nushell
|
./nushell
|
||||||
@@ -11,5 +10,4 @@
|
|||||||
./git.nix
|
./git.nix
|
||||||
./starship.nix
|
./starship.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{ config
|
{
|
||||||
, lib
|
config,
|
||||||
, pkgs
|
lib,
|
||||||
, ...
|
pkgs,
|
||||||
|
...
|
||||||
}: {
|
}: {
|
||||||
# `programs.git` will generate the config file: ~/.config/git/config
|
# `programs.git` will generate the config file: ~/.config/git/config
|
||||||
# to make git use this config file, `~/.gitconfig` should not exist!
|
# to make git use this config file, `~/.gitconfig` should not exist!
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: let
|
||||||
|
|
||||||
let
|
|
||||||
buildTmuxPlugin = pkgs.tmuxPlugins.mkTmuxPlugin;
|
buildTmuxPlugin = pkgs.tmuxPlugins.mkTmuxPlugin;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
draculaTheme = buildTmuxPlugin {
|
draculaTheme = buildTmuxPlugin {
|
||||||
pluginName = "dracula";
|
pluginName = "dracula";
|
||||||
version = "v2.2.0";
|
version = "v2.2.0";
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
plugins = pkgs.tmuxPlugins // pkgs.callPackage ./custom-plugins.nix {};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
plugins = pkgs.tmuxPlugins // pkgs.callPackage ./custom-plugins.nix {};
|
||||||
|
in {
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
shell = "${pkgs.nushell}/bin/nu";
|
shell = "${pkgs.nushell}/bin/nu";
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ ... }:
|
{...}: {
|
||||||
|
|
||||||
{
|
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
#
|
#
|
||||||
# MacOS specific home configuration
|
# MacOS specific home configuration
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../base/desktop
|
../base/desktop
|
||||||
|
|
||||||
@@ -12,9 +10,9 @@
|
|||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = {
|
home = {
|
||||||
username = "ryan";
|
username = username;
|
||||||
# set homeDirectory make build fail
|
# set homeDirectory make build fail
|
||||||
homeDirectory = "/Users/ryan";
|
homeDirectory = "/Users/${username}";
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# remove existing rime data (squirrel)
|
# remove existing rime data (squirrel)
|
||||||
home.activation.removeExistingRimeData = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
home.activation.removeExistingRimeData = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||||
rm -rf "~/Library/Rime/build/flypy.prism.bin"
|
rm -rf "~/Library/Rime/build/flypy.prism.bin"
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
{ config, ... }:
|
{config, ...}: let
|
||||||
|
|
||||||
let
|
|
||||||
d = config.xdg.dataHome;
|
d = config.xdg.dataHome;
|
||||||
c = config.xdg.configHome;
|
c = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
in
|
in rec {
|
||||||
rec {
|
|
||||||
# add environment variables
|
# add environment variables
|
||||||
systemd.user.sessionVariables = {
|
systemd.user.sessionVariables = {
|
||||||
# clean up ~
|
# clean up ~
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
# Linux Only Packages, not available on Darwin
|
# Linux Only Packages, not available on Darwin
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
btop # replacement of htop/nmon
|
btop # replacement of htop/nmon
|
||||||
@@ -42,5 +39,4 @@
|
|||||||
services = {
|
services = {
|
||||||
# syncthing.enable = true;
|
# syncthing.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../base/desktop
|
../base/desktop
|
||||||
|
|
||||||
@@ -13,12 +11,9 @@
|
|||||||
|
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = let
|
home = {
|
||||||
name = "ryan";
|
username = username;
|
||||||
in
|
homeDirectory = "/home/${username}";
|
||||||
{
|
|
||||||
username = name;
|
|
||||||
homeDirectory = "/home/${name}";
|
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../base/desktop
|
../base/desktop
|
||||||
|
|
||||||
@@ -13,12 +11,9 @@
|
|||||||
|
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = let
|
home = {
|
||||||
name = "ryan";
|
username = username;
|
||||||
in
|
homeDirectory = "/home/${username}";
|
||||||
{
|
|
||||||
username = name;
|
|
||||||
homeDirectory = "/home/${name}";
|
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# creative
|
# creative
|
||||||
# blender # 3d modeling
|
# blender # 3d modeling
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./creative.nix
|
./creative.nix
|
||||||
./immutable-file.nix
|
./immutable-file.nix
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{ config
|
{
|
||||||
, lib
|
config,
|
||||||
, pkgs
|
lib,
|
||||||
, ...
|
pkgs,
|
||||||
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
#
|
#
|
||||||
# Provide a option `home.immutable-file`, it works like `home.file` but make the generated file immutable.
|
# Provide a option `home.immutable-file`, it works like `home.file` but make the generated file immutable.
|
||||||
@@ -16,9 +16,7 @@
|
|||||||
# TODO not used yet, need to test it.
|
# TODO not used yet, need to test it.
|
||||||
#
|
#
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
|
with lib; let
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.home.immutable-file;
|
cfg = config.home.immutable-file;
|
||||||
immutableFileOpts = {...}: {
|
immutableFileOpts = {...}: {
|
||||||
options = {
|
options = {
|
||||||
@@ -44,16 +42,19 @@ let
|
|||||||
sudo cp $2 $1
|
sudo cp $2 $1
|
||||||
sudo chattr +i $1
|
sudo chattr +i $1
|
||||||
'';
|
'';
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.home.immutable-file = mkOption {
|
options.home.immutable-file = mkOption {
|
||||||
type = with types; attrsOf (submodule immutableFileOpts);
|
type = with types; attrsOf (submodule immutableFileOpts);
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg != {}) {
|
config = mkIf (cfg != {}) {
|
||||||
home.activation = mapAttrs'
|
home.activation =
|
||||||
(name: { src, dst }:
|
mapAttrs'
|
||||||
|
(name: {
|
||||||
|
src,
|
||||||
|
dst,
|
||||||
|
}:
|
||||||
nameValuePair
|
nameValuePair
|
||||||
"make-immutable-${name}"
|
"make-immutable-${name}"
|
||||||
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{ pkgs
|
{
|
||||||
, config
|
pkgs,
|
||||||
, ...
|
config,
|
||||||
|
...
|
||||||
}:
|
}:
|
||||||
# media - control and enjoy audio/video
|
# media - control and enjoy audio/video
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ pkgs
|
{pkgs, ...}: {
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
|
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
|
||||||
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
|
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
|
||||||
# https://www.freedesktop.org/wiki/Specifications/
|
# https://www.freedesktop.org/wiki/Specifications/
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
||||||
xdg-user-dirs
|
xdg-user-dirs
|
||||||
@@ -22,11 +25,9 @@
|
|||||||
# ls /etc/profiles/per-user/ryan/share/applications/
|
# ls /etc/profiles/per-user/ryan/share/applications/
|
||||||
mimeApps = {
|
mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultApplications =
|
defaultApplications = let
|
||||||
let
|
|
||||||
browser = ["firefox.desktop"];
|
browser = ["firefox.desktop"];
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
"application/json" = browser;
|
"application/json" = browser;
|
||||||
"application/pdf" = browser; # TODO: pdf viewer
|
"application/pdf" = browser; # TODO: pdf viewer
|
||||||
|
|
||||||
@@ -57,11 +58,9 @@
|
|||||||
"image/*" = ["imv.desktop"];
|
"image/*" = ["imv.desktop"];
|
||||||
};
|
};
|
||||||
|
|
||||||
associations.removed =
|
associations.removed = let
|
||||||
let
|
|
||||||
browser = ["google-chrome.desktop"];
|
browser = ["google-chrome.desktop"];
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
"text/html" = browser;
|
"text/html" = browser;
|
||||||
"text/xml" = browser;
|
"text/xml" = browser;
|
||||||
"application/xml" = browser;
|
"application/xml" = browser;
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
{ pkgs, config, lib, ... }: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.file.".config/fcitx5/profile".source = ./profile;
|
home.file.".config/fcitx5/profile".source = ./profile;
|
||||||
home.file.".config/fcitx5/profile-bak".source = ./profile; # used for backup
|
home.file.".config/fcitx5/profile-bak".source = ./profile; # used for backup
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ...}:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./wayland-apps.nix
|
./wayland-apps.nix
|
||||||
];
|
];
|
||||||
@@ -22,7 +21,6 @@
|
|||||||
home.file.".gtkrc-2.0".source = ./gtkrc-2.0;
|
home.file.".gtkrc-2.0".source = ./gtkrc-2.0;
|
||||||
home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png;
|
home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png;
|
||||||
|
|
||||||
|
|
||||||
# music player - mpd
|
# music player - mpd
|
||||||
home.file.".config/mpd" = {
|
home.file.".config/mpd" = {
|
||||||
source = ./mpd;
|
source = ./mpd;
|
||||||
@@ -58,5 +56,4 @@
|
|||||||
package = pkgs.qogir-theme;
|
package = pkgs.qogir-theme;
|
||||||
size = 64;
|
size = 64;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
{ pkgs
|
{pkgs, ...}: {
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
||||||
programs = {
|
programs = {
|
||||||
|
|
||||||
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
||||||
google-chrome = {
|
google-chrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ...}:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
{ pkgs
|
{pkgs, ...}: {
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
firefox
|
firefox
|
||||||
xsel # for clipboard support in x11, required by tmux's clipboard support
|
xsel # for clipboard support in x11, required by tmux's clipboard support
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
||||||
programs = {
|
programs = {
|
||||||
|
|
||||||
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
||||||
google-chrome = {
|
google-chrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../base/server
|
../base/server
|
||||||
|
|
||||||
@@ -9,12 +7,9 @@
|
|||||||
|
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = let
|
home = {
|
||||||
name = "ryan";
|
username = username;
|
||||||
in
|
homeDirectory = "/home/${username}";
|
||||||
{
|
|
||||||
username = name;
|
|
||||||
homeDirectory = "/home/${name}";
|
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
|
|||||||
+20
-11
@@ -1,25 +1,34 @@
|
|||||||
{ ... } @ args:
|
{ username, ... } @ args:
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Harmonica - my MacBook Pro 2020 13-inch, mainly for business.
|
# Harmonica - my MacBook Pro 2020 13-inch, mainly for business.
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "harmonica";
|
hostname = "harmonica";
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/darwin/core.nix
|
../../modules/darwin
|
||||||
../../modules/darwin/apps.nix
|
|
||||||
|
|
||||||
../../secrets/darwin.nix
|
../../secrets/darwin.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.overlays = import ../../overlays args;
|
nixpkgs.overlays = import ../../overlays args;
|
||||||
|
|
||||||
networking.hostName = name;
|
networking.hostName = hostname;
|
||||||
networking.computerName = name;
|
networking.computerName = hostname;
|
||||||
system.defaults.smb.NetBIOSName = name;
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
|
||||||
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
|
users.users."${username}" = {
|
||||||
|
home = "/Users/${username}";
|
||||||
|
description = username;
|
||||||
|
|
||||||
|
# set user's default shell back to zsh
|
||||||
|
# `chsh -s /bin/zsh`
|
||||||
|
# DO NOT change the system's default shell to nushell! it will break some apps!
|
||||||
|
# It's better to change only starship/alacritty/vscode's shell to nushell!
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings.trusted-users = [username];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# mount a smb/cifs share
|
# mount a smb/cifs share
|
||||||
fileSystems."/home/ryan/SMB-Downloads" = {
|
fileSystems."/home/${username}/SMB-Downloads" = {
|
||||||
device = "//192.168.5.194/Downloads";
|
device = "//192.168.5.194/Downloads";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = [
|
options = [
|
||||||
@@ -10,5 +14,3 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
{config, ...} @ args:
|
{config, ...} @ args:
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
|
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./cifs-mount.nix
|
./cifs-mount.nix
|
||||||
@@ -60,10 +58,12 @@
|
|||||||
enableIPv6 = false; # disable ipv6
|
enableIPv6 = false; # disable ipv6
|
||||||
interfaces.enp5s0 = {
|
interfaces.enp5s0 = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
ipv4.addresses = [{
|
ipv4.addresses = [
|
||||||
|
{
|
||||||
address = "192.168.5.100";
|
address = "192.168.5.100";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
defaultGateway = "192.168.5.201";
|
defaultGateway = "192.168.5.201";
|
||||||
nameservers = [
|
nameservers = [
|
||||||
@@ -98,5 +98,4 @@
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
config,
|
||||||
[
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -14,21 +17,18 @@
|
|||||||
boot.kernelModules = ["kvm-intel"];
|
boot.kernelModules = ["kvm-intel"];
|
||||||
boot.extraModulePackages = [];
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{
|
|
||||||
device = "/dev/disk/by-uuid/231466f6-cdf3-40e1-b9d2-6b4e8d10a4d3";
|
device = "/dev/disk/by-uuid/231466f6-cdf3-40e1-b9d2-6b4e8d10a4d3";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@"];
|
options = ["subvol=@"];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot/efi" =
|
fileSystems."/boot/efi" = {
|
||||||
{
|
|
||||||
device = "/dev/disk/by-uuid/87ED-8B2E";
|
device = "/dev/disk/by-uuid/87ED-8B2E";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [{device = "/dev/disk/by-uuid/17391ca0-8cdb-4598-a40b-fd9548fd9b37";}];
|
||||||
[{ device = "/dev/disk/by-uuid/17391ca0-8cdb-4598-a40b-fd9548fd9b37"; }];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# 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
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
{...} @ args:
|
{...} @ args:
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Aquamarine - A NixOS VM running on Proxmox
|
# Aquamarine - A NixOS VM running on Proxmox
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
{
|
{
|
||||||
@@ -21,7 +19,6 @@
|
|||||||
|
|
||||||
nixpkgs.overlays = import ../../../overlays args;
|
nixpkgs.overlays = import ../../../overlays args;
|
||||||
|
|
||||||
|
|
||||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||||
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
||||||
# supported fil systems, so we can mount any removable disks with these filesystems
|
# supported fil systems, so we can mount any removable disks with these filesystems
|
||||||
@@ -48,10 +45,12 @@
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
interfaces.ens18 = {
|
interfaces.ens18 = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
ipv4.addresses = [{
|
ipv4.addresses = [
|
||||||
|
{
|
||||||
address = "192.168.5.101";
|
address = "192.168.5.101";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
defaultGateway = "192.168.5.201";
|
defaultGateway = "192.168.5.201";
|
||||||
nameservers = [
|
nameservers = [
|
||||||
@@ -67,5 +66,4 @@
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
{...} @ args:
|
{...} @ args:
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Kana - a NixOS VM running on Proxmox
|
# Kana - a NixOS VM running on Proxmox
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
{
|
{
|
||||||
@@ -21,7 +19,6 @@
|
|||||||
|
|
||||||
nixpkgs.overlays = import ../../../overlays args;
|
nixpkgs.overlays = import ../../../overlays args;
|
||||||
|
|
||||||
|
|
||||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||||
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
||||||
# supported fil systems, so we can mount any removable disks with these filesystems
|
# supported fil systems, so we can mount any removable disks with these filesystems
|
||||||
@@ -48,10 +45,12 @@
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
interfaces.ens18 = {
|
interfaces.ens18 = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
ipv4.addresses = [{
|
ipv4.addresses = [
|
||||||
|
{
|
||||||
address = "192.168.5.103";
|
address = "192.168.5.103";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
defaultGateway = "192.168.5.201";
|
defaultGateway = "192.168.5.201";
|
||||||
nameservers = [
|
nameservers = [
|
||||||
@@ -67,5 +66,4 @@
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.05"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
{...} @ args:
|
{...} @ args:
|
||||||
|
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Ruby - a NixOS VM running on Proxmox
|
# Ruby - a NixOS VM running on Proxmox
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
{
|
{
|
||||||
@@ -23,7 +19,6 @@
|
|||||||
|
|
||||||
nixpkgs.overlays = import ../../../overlays args;
|
nixpkgs.overlays = import ../../../overlays args;
|
||||||
|
|
||||||
|
|
||||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||||
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
||||||
# supported fil systems, so we can mount any removable disks with these filesystems
|
# supported fil systems, so we can mount any removable disks with these filesystems
|
||||||
@@ -50,10 +45,12 @@
|
|||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
interfaces.ens18 = {
|
interfaces.ens18 = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
ipv4.addresses = [{
|
ipv4.addresses = [
|
||||||
|
{
|
||||||
address = "192.168.5.102";
|
address = "192.168.5.102";
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
defaultGateway = "192.168.5.201";
|
defaultGateway = "192.168.5.201";
|
||||||
nameservers = [
|
nameservers = [
|
||||||
@@ -69,5 +66,4 @@
|
|||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
system.stateVersion = "23.05"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
nix-darwin,
|
||||||
|
home-manager,
|
||||||
|
system,
|
||||||
|
specialArgs,
|
||||||
|
darwin-modules,
|
||||||
|
home-module,
|
||||||
|
}: let
|
||||||
|
username = specialArgs.username;
|
||||||
|
in
|
||||||
|
nix-darwin.lib.darwinSystem {
|
||||||
|
inherit system specialArgs;
|
||||||
|
modules =
|
||||||
|
darwin-modules
|
||||||
|
++ [
|
||||||
|
home-manager.darwinModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
home-manager.extraSpecialArgs = specialArgs;
|
||||||
|
home-manager.users."${username}" = home-module;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
nixos-generators,
|
||||||
|
system,
|
||||||
|
specialArgs,
|
||||||
|
nixos-modules,
|
||||||
|
home-module,
|
||||||
|
}: let
|
||||||
|
username = specialArgs.username;
|
||||||
|
in
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
inherit system specialArgs;
|
||||||
|
modules =
|
||||||
|
nixos-modules
|
||||||
|
++ [
|
||||||
|
nixos-generators.nixosModules.all-formats
|
||||||
|
{
|
||||||
|
# formatConfigs.iso = {config, ...}: {};
|
||||||
|
formatConfigs.proxmox = {config, ...}: {
|
||||||
|
# custom proxmox's image name
|
||||||
|
proxmox.qemuConf.name = "${config.networking.hostName}-nixos-${config.system.nixos.label}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
home-manager.extraSpecialArgs = specialArgs;
|
||||||
|
home-manager.users."${username}" = home-module;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
+28
-131
@@ -1,140 +1,35 @@
|
|||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
#
|
#
|
||||||
# MacOS specific nix-darwin configuration
|
# Install all apps and packages here.
|
||||||
#
|
#
|
||||||
# Nix is not well supported on macOS, I met some strange bug recently.
|
# NOTE: Your can find all available options in:
|
||||||
# So install apps using [homebrew](https://daiderd.com/nix-darwin/manual/index.html#opt-homebrew.enable) here.
|
# https://daiderd.com/nix-darwin/manual/index.html
|
||||||
|
#
|
||||||
|
# TODO Fell free to modify this file to fit your needs.
|
||||||
#
|
#
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
system = {
|
# Install packages from nix's official package repository.
|
||||||
|
|
||||||
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
|
||||||
activationScripts.postUserActivation.text = ''
|
|
||||||
# activateSettings -u will reload the settings from the database and apply them to the current session,
|
|
||||||
# so we do not need to logout and login again to make the changes take effect.
|
|
||||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
|
||||||
'';
|
|
||||||
|
|
||||||
defaults = {
|
|
||||||
menuExtraClock.Show24Hour = true; # show 24 hour clock
|
|
||||||
|
|
||||||
# customize dock
|
|
||||||
dock = {
|
|
||||||
autohide = true;
|
|
||||||
show-recents = false; # disable recent apps
|
|
||||||
|
|
||||||
# customize Hot Corners(触发角, 鼠标移动到屏幕角落时触发的动作)
|
|
||||||
wvous-tl-corner = 2; # top-left - Mission Control
|
|
||||||
wvous-tr-corner = 13; # top-right - Lock Screen
|
|
||||||
wvous-bl-corner = 3; # bottom-left - Application Windows
|
|
||||||
wvous-br-corner = 4; # bottom-right - Desktop
|
|
||||||
};
|
|
||||||
|
|
||||||
# customize finder
|
|
||||||
finder = {
|
|
||||||
_FXShowPosixPathInTitle = true; # show full path in finder title
|
|
||||||
AppleShowAllExtensions = true; # show all file extensions
|
|
||||||
FXEnableExtensionChangeWarning = false; # disable warning when changing file extension
|
|
||||||
QuitMenuItem = true; # enable quit menu item
|
|
||||||
ShowPathbar = true; # show path bar
|
|
||||||
ShowStatusBar = true; # show status bar
|
|
||||||
};
|
|
||||||
|
|
||||||
# customize trackpad
|
|
||||||
trackpad = {
|
|
||||||
# tap - 轻触触摸板, click - 点击触摸板
|
|
||||||
Clicking = true; # enable tap to click(轻触触摸板相当于点击)
|
|
||||||
TrackpadRightClick = true; # enable two finger right click
|
|
||||||
TrackpadThreeFingerDrag = true; # enable three finger drag
|
|
||||||
};
|
|
||||||
|
|
||||||
# customize macOS
|
|
||||||
NSGlobalDomain = {
|
|
||||||
# `defaults read NSGlobalDomain "xxx"`
|
|
||||||
"com.apple.swipescrolldirection" = true; # enable natural scrolling(default to true)
|
|
||||||
"com.apple.sound.beep.feedback" = 0; # disable beep sound when pressing volume up/down key
|
|
||||||
AppleInterfaceStyle = "Dark"; # dark mode
|
|
||||||
AppleKeyboardUIMode = 3; # Mode 3 enables full keyboard control.
|
|
||||||
ApplePressAndHoldEnabled = true; # enable press and hold
|
|
||||||
|
|
||||||
# If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat.
|
|
||||||
# This is very useful for vim users, they use `hjkl` to move cursor.
|
|
||||||
# sets how long it takes before it starts repeating.
|
|
||||||
InitialKeyRepeat = 15; # normal minimum is 15 (225 ms), maximum is 120 (1800 ms)
|
|
||||||
# sets how fast it repeats once it starts.
|
|
||||||
KeyRepeat = 3; # normal minimum is 2 (30 ms), maximum is 120 (1800 ms)
|
|
||||||
|
|
||||||
NSAutomaticCapitalizationEnabled = false; # disable auto capitalization(自动大写)
|
|
||||||
NSAutomaticDashSubstitutionEnabled = false; # disable auto dash substitution(智能破折号替换)
|
|
||||||
NSAutomaticPeriodSubstitutionEnabled = false; # disable auto period substitution(智能句号替换)
|
|
||||||
NSAutomaticQuoteSubstitutionEnabled = false; # disable auto quote substitution(智能引号替换)
|
|
||||||
NSAutomaticSpellingCorrectionEnabled = false; # disable auto spelling correction(自动拼写检查)
|
|
||||||
NSNavPanelExpandedStateForSaveMode = true; # expand save panel by default(保存文件时的路径选择/文件名输入页)
|
|
||||||
NSNavPanelExpandedStateForSaveMode2 = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# customize settings that not supported by nix-darwin directly
|
|
||||||
CustomUserPreferences = {
|
|
||||||
NSGlobalDomain = {
|
|
||||||
# Add a context menu item for showing the Web Inspector in web views
|
|
||||||
WebKitDeveloperExtras = true;
|
|
||||||
};
|
|
||||||
"com.apple.finder" = {
|
|
||||||
ShowExternalHardDrivesOnDesktop = true;
|
|
||||||
ShowHardDrivesOnDesktop = true;
|
|
||||||
ShowMountedServersOnDesktop = true;
|
|
||||||
ShowRemovableMediaOnDesktop = true;
|
|
||||||
_FXSortFoldersFirst = true;
|
|
||||||
# When performing a search, search the current folder by default
|
|
||||||
FXDefaultSearchScope = "SCcf";
|
|
||||||
};
|
|
||||||
"com.apple.desktopservices" = {
|
|
||||||
# Avoid creating .DS_Store files on network or USB volumes
|
|
||||||
DSDontWriteNetworkStores = true;
|
|
||||||
DSDontWriteUSBStores = true;
|
|
||||||
};
|
|
||||||
"com.apple.screensaver" = {
|
|
||||||
# Require password immediately after sleep or screen saver begins
|
|
||||||
askForPassword = 1;
|
|
||||||
askForPasswordDelay = 0;
|
|
||||||
};
|
|
||||||
"com.apple.screencapture" = {
|
|
||||||
location = "~/Desktop";
|
|
||||||
type = "png";
|
|
||||||
};
|
|
||||||
"com.apple.AdLib" = {
|
|
||||||
allowApplePersonalizedAdvertising = false;
|
|
||||||
};
|
|
||||||
# Prevent Photos from opening automatically when devices are plugged in
|
|
||||||
"com.apple.ImageCapture".disableHotPlug = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
loginwindow = {
|
|
||||||
GuestEnabled = false; # disable guest user
|
|
||||||
SHOWFULLNAME = true; # show full name in login window
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# keyboard settings is not very useful on macOS
|
|
||||||
# the most important thing is to remap option key to alt key globally,
|
|
||||||
# but it's not supported by macOS yet.
|
|
||||||
keyboard = {
|
|
||||||
enableKeyMapping = true; # enable key mapping so that we can use `option` as `control`
|
|
||||||
|
|
||||||
# NOTE: do NOT support remap capslock to both control and escape at the same time
|
|
||||||
remapCapsLockToControl = false; # remap caps lock to control, useful for emac users
|
|
||||||
remapCapsLockToEscape = true; # remap caps lock to escape, useful for vim users
|
|
||||||
|
|
||||||
# swap left command and left alt
|
|
||||||
# so it matches common keyboard layout: `ctrl | command | alt`
|
|
||||||
#
|
#
|
||||||
# disabled, caused only problems!
|
# The packages installed here are available to all users, and are reproducible across machines, and are rollbackable.
|
||||||
swapLeftCommandAndLeftAlt = false;
|
# But on macOS, it's less stable than homebrew.
|
||||||
};
|
#
|
||||||
};
|
# Related Discussion: https://discourse.nixos.org/t/darwin-again/29331
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
neovim
|
||||||
|
git
|
||||||
|
nushell # my custom shell
|
||||||
|
];
|
||||||
|
environment.variables.EDITOR = "nvim";
|
||||||
|
|
||||||
|
# Create /etc/zshrc that loads the nix-darwin environment.
|
||||||
|
# this is required if you want to use darwin's default shell - zsh
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
environment.shells = [
|
||||||
|
pkgs.zsh
|
||||||
|
pkgs.nushell # my custom shell
|
||||||
|
];
|
||||||
|
|
||||||
# Homebrew Mirror
|
# Homebrew Mirror
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
@@ -145,12 +40,11 @@
|
|||||||
HOMEBREW_PIP_INDEX_URL = "https://pypi.tuna.tsinghua.edu.cn/simple";
|
HOMEBREW_PIP_INDEX_URL = "https://pypi.tuna.tsinghua.edu.cn/simple";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# homebrew need to be installed manually, see https://brew.sh
|
# homebrew need to be installed manually, see https://brew.sh
|
||||||
homebrew = {
|
homebrew = {
|
||||||
# TODO Homebrew install takes a long time,
|
# TODO Homebrew install takes a long time,
|
||||||
# So only enable this when you make changes.
|
# So only enable this when you make changes.
|
||||||
enable = false;
|
enable = true;
|
||||||
|
|
||||||
onActivation = {
|
onActivation = {
|
||||||
autoUpdate = false;
|
autoUpdate = false;
|
||||||
@@ -195,6 +89,9 @@
|
|||||||
# 1. `sudo tailscaled install-system-daemon`
|
# 1. `sudo tailscaled install-system-daemon`
|
||||||
# 2. `tailscale up --accept-routes`
|
# 2. `tailscale up --accept-routes`
|
||||||
"tailscale" # tailscale
|
"tailscale" # tailscale
|
||||||
|
|
||||||
|
# https://github.com/rgcr/m-cli
|
||||||
|
"m-cli" # Swiss Army Knife for macOS
|
||||||
];
|
];
|
||||||
|
|
||||||
# `brew install --cask`
|
# `brew install --cask`
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
|
|
||||||
{ pkgs, lib, ... }:
|
|
||||||
{
|
|
||||||
###################################################################################
|
|
||||||
#
|
|
||||||
# Core configuration for nix-darwin
|
|
||||||
#
|
|
||||||
# All the configuration options are documented here:
|
|
||||||
# https://daiderd.com/nix-darwin/manual/index.html#sec-options
|
|
||||||
#
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
# enable flakes globally
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
|
|
||||||
nix.settings.trusted-users = ["ryan"];
|
|
||||||
|
|
||||||
# Allow unfree packages
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# Auto upgrade nix package and the daemon service.
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
# Use this instead of services.nix-daemon.enable if you
|
|
||||||
# don't wan't the daemon service to be managed for you.
|
|
||||||
# nix.useDaemon = true;
|
|
||||||
|
|
||||||
nix.package = pkgs.nix;
|
|
||||||
|
|
||||||
programs.nix-index.enable = true;
|
|
||||||
|
|
||||||
# boot.loader.grub.configurationLimit = 10;
|
|
||||||
# do garbage collection weekly to keep disk usage low
|
|
||||||
nix.gc = {
|
|
||||||
automatic = lib.mkDefault true;
|
|
||||||
options = lib.mkDefault "--delete-older-than 1w";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Manual optimise storage: nix-store --optimise
|
|
||||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
|
||||||
nix.settings.auto-optimise-store = true;
|
|
||||||
|
|
||||||
# Add ability to used TouchID for sudo authentication
|
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
|
||||||
|
|
||||||
# Set your time zone.
|
|
||||||
# comment this due to the issue:
|
|
||||||
# https://github.com/LnL7/nix-darwin/issues/359
|
|
||||||
# time.timeZone = "Asia/shanghai";
|
|
||||||
|
|
||||||
# Apps
|
|
||||||
# `home-manager` currently has issues adding them to `~/Applications`
|
|
||||||
# Issue: https://github.com/nix-community/home-manager/issues/1341
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
neovim
|
|
||||||
git
|
|
||||||
nushell # my custom shell
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.variables.EDITOR = "nvim";
|
|
||||||
|
|
||||||
# Fonts
|
|
||||||
fonts = {
|
|
||||||
# use fonts specified by user rather than default ones
|
|
||||||
fontDir.enable = true;
|
|
||||||
|
|
||||||
fonts = with pkgs; [
|
|
||||||
# icon fonts
|
|
||||||
material-design-icons
|
|
||||||
font-awesome
|
|
||||||
|
|
||||||
# nerdfonts
|
|
||||||
(nerdfonts.override {
|
|
||||||
fonts = [
|
|
||||||
"FiraCode"
|
|
||||||
"JetBrainsMono"
|
|
||||||
"Iosevka"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
||||||
users.users.ryan = {
|
|
||||||
home = "/Users/ryan";
|
|
||||||
description = "ryan";
|
|
||||||
|
|
||||||
# set user's default shell back to zsh
|
|
||||||
# `chsh -s /bin/zsh`
|
|
||||||
# DO NOT change the system's default shell to nushell! it will break some apps!
|
|
||||||
# It's better to change only starship/alacritty/vscode's shell to nushell!
|
|
||||||
};
|
|
||||||
|
|
||||||
# Create /etc/zshrc that loads the nix-darwin environment.
|
|
||||||
# this is required if you want to use darwin's default shell - zsh
|
|
||||||
programs.zsh.enable = true;
|
|
||||||
environment.shells = [
|
|
||||||
pkgs.zsh
|
|
||||||
pkgs.nushell # my custom shell
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./apps.nix
|
||||||
|
./nix-core.nix
|
||||||
|
./system.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
###################################################################################
|
||||||
|
#
|
||||||
|
# Core configuration for nix-darwin
|
||||||
|
#
|
||||||
|
# All the configuration options are documented here:
|
||||||
|
# https://daiderd.com/nix-darwin/manual/index.html#sec-options
|
||||||
|
#
|
||||||
|
###################################################################################
|
||||||
|
|
||||||
|
# enable flakes globally
|
||||||
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||||
|
|
||||||
|
# Allow unfree packages
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# Auto upgrade nix package and the daemon service.
|
||||||
|
services.nix-daemon.enable = true;
|
||||||
|
# Use this instead of services.nix-daemon.enable if you
|
||||||
|
# don't wan't the daemon service to be managed for you.
|
||||||
|
# nix.useDaemon = true;
|
||||||
|
|
||||||
|
nix.package = pkgs.nix;
|
||||||
|
|
||||||
|
programs.nix-index.enable = true;
|
||||||
|
|
||||||
|
# boot.loader.grub.configurationLimit = 10;
|
||||||
|
# do garbage collection weekly to keep disk usage low
|
||||||
|
nix.gc = {
|
||||||
|
automatic = lib.mkDefault true;
|
||||||
|
options = lib.mkDefault "--delete-older-than 1w";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Manual optimise storage: nix-store --optimise
|
||||||
|
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||||
|
nix.settings.auto-optimise-store = true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
{pkgs, ...}:
|
||||||
|
###################################################################################
|
||||||
|
#
|
||||||
|
# macOS's System configuration
|
||||||
|
#
|
||||||
|
# All the configuration options are documented here:
|
||||||
|
# https://daiderd.com/nix-darwin/manual/index.html#sec-options
|
||||||
|
#
|
||||||
|
###################################################################################
|
||||||
|
{
|
||||||
|
# Add ability to used TouchID for sudo authentication
|
||||||
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
|
|
||||||
|
system = {
|
||||||
|
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
||||||
|
activationScripts.postUserActivation.text = ''
|
||||||
|
# activateSettings -u will reload the settings from the database and apply them to the current session,
|
||||||
|
# so we do not need to logout and login again to make the changes take effect.
|
||||||
|
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||||
|
'';
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
menuExtraClock.Show24Hour = true; # show 24 hour clock
|
||||||
|
|
||||||
|
# customize dock
|
||||||
|
dock = {
|
||||||
|
autohide = true;
|
||||||
|
show-recents = false; # disable recent apps
|
||||||
|
|
||||||
|
# customize Hot Corners(触发角, 鼠标移动到屏幕角落时触发的动作)
|
||||||
|
wvous-tl-corner = 2; # top-left - Mission Control
|
||||||
|
wvous-tr-corner = 13; # top-right - Lock Screen
|
||||||
|
wvous-bl-corner = 3; # bottom-left - Application Windows
|
||||||
|
wvous-br-corner = 4; # bottom-right - Desktop
|
||||||
|
};
|
||||||
|
|
||||||
|
# customize finder
|
||||||
|
finder = {
|
||||||
|
_FXShowPosixPathInTitle = true; # show full path in finder title
|
||||||
|
AppleShowAllExtensions = true; # show all file extensions
|
||||||
|
FXEnableExtensionChangeWarning = false; # disable warning when changing file extension
|
||||||
|
QuitMenuItem = true; # enable quit menu item
|
||||||
|
ShowPathbar = true; # show path bar
|
||||||
|
ShowStatusBar = true; # show status bar
|
||||||
|
};
|
||||||
|
|
||||||
|
# customize trackpad
|
||||||
|
trackpad = {
|
||||||
|
# tap - 轻触触摸板, click - 点击触摸板
|
||||||
|
Clicking = true; # enable tap to click(轻触触摸板相当于点击)
|
||||||
|
TrackpadRightClick = true; # enable two finger right click
|
||||||
|
TrackpadThreeFingerDrag = true; # enable three finger drag
|
||||||
|
};
|
||||||
|
|
||||||
|
# customize macOS
|
||||||
|
NSGlobalDomain = {
|
||||||
|
# `defaults read NSGlobalDomain "xxx"`
|
||||||
|
"com.apple.swipescrolldirection" = true; # enable natural scrolling(default to true)
|
||||||
|
"com.apple.sound.beep.feedback" = 0; # disable beep sound when pressing volume up/down key
|
||||||
|
AppleInterfaceStyle = "Dark"; # dark mode
|
||||||
|
AppleKeyboardUIMode = 3; # Mode 3 enables full keyboard control.
|
||||||
|
ApplePressAndHoldEnabled = true; # enable press and hold
|
||||||
|
|
||||||
|
# If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat.
|
||||||
|
# This is very useful for vim users, they use `hjkl` to move cursor.
|
||||||
|
# sets how long it takes before it starts repeating.
|
||||||
|
InitialKeyRepeat = 15; # normal minimum is 15 (225 ms), maximum is 120 (1800 ms)
|
||||||
|
# sets how fast it repeats once it starts.
|
||||||
|
KeyRepeat = 3; # normal minimum is 2 (30 ms), maximum is 120 (1800 ms)
|
||||||
|
|
||||||
|
NSAutomaticCapitalizationEnabled = false; # disable auto capitalization(自动大写)
|
||||||
|
NSAutomaticDashSubstitutionEnabled = false; # disable auto dash substitution(智能破折号替换)
|
||||||
|
NSAutomaticPeriodSubstitutionEnabled = false; # disable auto period substitution(智能句号替换)
|
||||||
|
NSAutomaticQuoteSubstitutionEnabled = false; # disable auto quote substitution(智能引号替换)
|
||||||
|
NSAutomaticSpellingCorrectionEnabled = false; # disable auto spelling correction(自动拼写检查)
|
||||||
|
NSNavPanelExpandedStateForSaveMode = true; # expand save panel by default(保存文件时的路径选择/文件名输入页)
|
||||||
|
NSNavPanelExpandedStateForSaveMode2 = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# customize settings that not supported by nix-darwin directly
|
||||||
|
CustomUserPreferences = {
|
||||||
|
NSGlobalDomain = {
|
||||||
|
# Add a context menu item for showing the Web Inspector in web views
|
||||||
|
WebKitDeveloperExtras = true;
|
||||||
|
};
|
||||||
|
"com.apple.finder" = {
|
||||||
|
ShowExternalHardDrivesOnDesktop = true;
|
||||||
|
ShowHardDrivesOnDesktop = true;
|
||||||
|
ShowMountedServersOnDesktop = true;
|
||||||
|
ShowRemovableMediaOnDesktop = true;
|
||||||
|
_FXSortFoldersFirst = true;
|
||||||
|
# When performing a search, search the current folder by default
|
||||||
|
FXDefaultSearchScope = "SCcf";
|
||||||
|
};
|
||||||
|
"com.apple.desktopservices" = {
|
||||||
|
# Avoid creating .DS_Store files on network or USB volumes
|
||||||
|
DSDontWriteNetworkStores = true;
|
||||||
|
DSDontWriteUSBStores = true;
|
||||||
|
};
|
||||||
|
"com.apple.screensaver" = {
|
||||||
|
# Require password immediately after sleep or screen saver begins
|
||||||
|
askForPassword = 1;
|
||||||
|
askForPasswordDelay = 0;
|
||||||
|
};
|
||||||
|
"com.apple.screencapture" = {
|
||||||
|
location = "~/Desktop";
|
||||||
|
type = "png";
|
||||||
|
};
|
||||||
|
"com.apple.AdLib" = {
|
||||||
|
allowApplePersonalizedAdvertising = false;
|
||||||
|
};
|
||||||
|
# Prevent Photos from opening automatically when devices are plugged in
|
||||||
|
"com.apple.ImageCapture".disableHotPlug = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
loginwindow = {
|
||||||
|
GuestEnabled = false; # disable guest user
|
||||||
|
SHOWFULLNAME = true; # show full name in login window
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# keyboard settings is not very useful on macOS
|
||||||
|
# the most important thing is to remap option key to alt key globally,
|
||||||
|
# but it's not supported by macOS yet.
|
||||||
|
keyboard = {
|
||||||
|
enableKeyMapping = true; # enable key mapping so that we can use `option` as `control`
|
||||||
|
|
||||||
|
# NOTE: do NOT support remap capslock to both control and escape at the same time
|
||||||
|
remapCapsLockToControl = false; # remap caps lock to control, useful for emac users
|
||||||
|
remapCapsLockToEscape = true; # remap caps lock to escape, useful for vim users
|
||||||
|
|
||||||
|
# swap left command and left alt
|
||||||
|
# so it matches common keyboard layout: `ctrl | command | alt`
|
||||||
|
#
|
||||||
|
# disabled, caused only problems!
|
||||||
|
swapLeftCommandAndLeftAlt = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
# comment this due to the issue:
|
||||||
|
# https://github.com/LnL7/nix-darwin/issues/359
|
||||||
|
# time.timeZone = "Asia/shanghai";
|
||||||
|
|
||||||
|
# Fonts
|
||||||
|
fonts = {
|
||||||
|
# use fonts specified by user rather than default ones
|
||||||
|
fontDir.enable = true;
|
||||||
|
|
||||||
|
fonts = with pkgs; [
|
||||||
|
# icon fonts
|
||||||
|
material-design-icons
|
||||||
|
font-awesome
|
||||||
|
|
||||||
|
# nerdfonts
|
||||||
|
(nerdfonts.override {
|
||||||
|
fonts = [
|
||||||
|
"FiraCode"
|
||||||
|
"JetBrainsMono"
|
||||||
|
"Iosevka"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
###################################################################################
|
###################################################################################
|
||||||
#
|
#
|
||||||
# NixOS's core configuration suitable for my desktop computer
|
# NixOS's core configuration suitable for my desktop computer
|
||||||
@@ -17,20 +19,6 @@
|
|||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
|
||||||
# DO NOT promote ryan to input password for `nix-store` and `nix-copy-closure`
|
|
||||||
security.sudo.extraRules = [
|
|
||||||
{ users = [ "ryan" ];
|
|
||||||
commands = [
|
|
||||||
{ command = "/run/current-system/sw/bin/nix-store" ;
|
|
||||||
options = [ "NOPASSWD" ];
|
|
||||||
}
|
|
||||||
{ command = "/run/current-system/sw/bin/nix-copy-closure" ;
|
|
||||||
options = [ "NOPASSWD" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
# all fonts are linked to /nix/var/nix/profiles/system/sw/share/X11/fonts
|
# all fonts are linked to /nix/var/nix/profiles/system/sw/share/X11/fonts
|
||||||
fonts = {
|
fonts = {
|
||||||
# use fonts specified by user rather than default ones
|
# use fonts specified by user rather than default ones
|
||||||
@@ -107,7 +95,8 @@
|
|||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# python, some times I may need to use python with root permission.
|
# python, some times I may need to use python with root permission.
|
||||||
(python310.withPackages (ps: with ps; [
|
(python310.withPackages (ps:
|
||||||
|
with ps; [
|
||||||
ipython
|
ipython
|
||||||
pandas
|
pandas
|
||||||
requests
|
requests
|
||||||
@@ -167,7 +156,6 @@
|
|||||||
services.gnome.gnome-keyring.enable = true;
|
services.gnome.gnome-keyring.enable = true;
|
||||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||||
|
|
||||||
|
|
||||||
# A key remapping daemon for linux.
|
# A key remapping daemon for linux.
|
||||||
# https://github.com/rvaiya/keyd
|
# https://github.com/rvaiya/keyd
|
||||||
services.keyd = {
|
services.keyd = {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
###################################################################################
|
###################################################################################
|
||||||
#
|
#
|
||||||
# NixOS's core configuration suitable for all my machines
|
# NixOS's core configuration suitable for all my machines
|
||||||
@@ -24,7 +26,6 @@
|
|||||||
# enable flakes globally
|
# enable flakes globally
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||||
|
|
||||||
|
|
||||||
# Allow unfree packages
|
# Allow unfree packages
|
||||||
nixpkgs.config.allowUnfree = lib.mkDefault false;
|
nixpkgs.config.allowUnfree = lib.mkDefault false;
|
||||||
|
|
||||||
@@ -74,8 +75,11 @@
|
|||||||
|
|
||||||
# create a fhs environment by command `fhs`, so we can run non-nixos packages in nixos!
|
# create a fhs environment by command `fhs`, so we can run non-nixos packages in nixos!
|
||||||
(
|
(
|
||||||
let base = pkgs.appimageTools.defaultFhsEnvArgs; in
|
let
|
||||||
pkgs.buildFHSUserEnv (base // {
|
base = pkgs.appimageTools.defaultFhsEnvArgs;
|
||||||
|
in
|
||||||
|
pkgs.buildFHSUserEnv (base
|
||||||
|
// {
|
||||||
name = "fhs";
|
name = "fhs";
|
||||||
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [pkgs.pkg-config];
|
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [pkgs.pkg-config];
|
||||||
profile = "export FHS=1";
|
profile = "export FHS=1";
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
###################################################################################
|
###################################################################################
|
||||||
#
|
#
|
||||||
# Copy from https://github.com/NixOS/nixpkgs/issues/119433#issuecomment-1326957279
|
# Copy from https://github.com/NixOS/nixpkgs/issues/119433#issuecomment-1326957279
|
||||||
@@ -12,8 +14,7 @@
|
|||||||
###################################################################################
|
###################################################################################
|
||||||
|
|
||||||
system.fsPackages = [pkgs.bindfs];
|
system.fsPackages = [pkgs.bindfs];
|
||||||
fileSystems =
|
fileSystems = let
|
||||||
let
|
|
||||||
mkRoSymBind = path: {
|
mkRoSymBind = path: {
|
||||||
device = path;
|
device = path;
|
||||||
fsType = "fuse.bindfs";
|
fsType = "fuse.bindfs";
|
||||||
@@ -24,8 +25,7 @@
|
|||||||
paths = config.fonts.fonts;
|
paths = config.fonts.fonts;
|
||||||
pathsToLink = ["/share/fonts"];
|
pathsToLink = ["/share/fonts"];
|
||||||
};
|
};
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
# Create an FHS mount to support flatpak host icons/fonts
|
# Create an FHS mount to support flatpak host icons/fonts
|
||||||
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
|
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
|
||||||
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
|
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
#
|
#
|
||||||
# NixOS's Configuration for Hyprland Window Manager
|
# NixOS's Configuration for Hyprland Window Manager
|
||||||
@@ -13,7 +9,6 @@
|
|||||||
#
|
#
|
||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
|
|
||||||
|
|
||||||
environment.pathsToLink = ["/libexec"]; # links /libexec from derivations to /run/current-system/sw
|
environment.pathsToLink = ["/libexec"]; # links /libexec from derivations to /run/current-system/sw
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -44,7 +39,6 @@
|
|||||||
};
|
};
|
||||||
programs.light.enable = true; # monitor backlight control
|
programs.light.enable = true; # monitor backlight control
|
||||||
|
|
||||||
|
|
||||||
# thunar file manager(part of xfce) related options
|
# thunar file manager(part of xfce) related options
|
||||||
programs.thunar.plugins = with pkgs.xfce; [
|
programs.thunar.plugins = with pkgs.xfce; [
|
||||||
thunar-archive-plugin
|
thunar-archive-plugin
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
|
|
||||||
{
|
|
||||||
####################################################################
|
####################################################################
|
||||||
#
|
#
|
||||||
# NixOS's Configuration for I3 Window Manager
|
# NixOS's Configuration for I3 Window Manager
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
{ lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
###################################################################################
|
###################################################################################
|
||||||
#
|
#
|
||||||
# Enable Libvirt(QEMU/KVM), install qemu-system-riscv64/qemu-system-loongarch64/...)
|
# Enable Libvirt(QEMU/KVM), install qemu-system-riscv64/qemu-system-loongarch64/...)
|
||||||
@@ -42,7 +43,6 @@
|
|||||||
boot.extraModprobeConfig = "options kvm_intel nested=1"; # for intel cpu
|
boot.extraModprobeConfig = "options kvm_intel nested=1"; # for intel cpu
|
||||||
# boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
# boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
||||||
|
|
||||||
|
|
||||||
# NixOS VM should enable this:
|
# NixOS VM should enable this:
|
||||||
# services.qemuGuest = {
|
# services.qemuGuest = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
{ config, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}:
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Template for Proxmox's VM, mainly based on:
|
# Template for Proxmox's VM, mainly based on:
|
||||||
@@ -8,16 +12,16 @@
|
|||||||
# the url above is used by `nixos-generator` to generate the Proxmox's VMA image file.
|
# the url above is used by `nixos-generator` to generate the Proxmox's VMA image file.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# DO NOT promote ryan to input password for sudo.
|
# DO NOT promote ryan to input password for sudo.
|
||||||
# this is a workaround for the issue of remote deploy:
|
# this is a workaround for the issue of remote deploy:
|
||||||
# https://github.com/NixOS/nixpkgs/issues/118655
|
# https://github.com/NixOS/nixpkgs/issues/118655
|
||||||
security.sudo.extraRules = [
|
security.sudo.extraRules = [
|
||||||
{ users = [ "ryan" ];
|
{
|
||||||
|
users = [ username ];
|
||||||
commands = [
|
commands = [
|
||||||
{ command = "ALL" ;
|
{
|
||||||
|
command = "ALL";
|
||||||
options = ["NOPASSWD"];
|
options = ["NOPASSWD"];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -36,7 +40,7 @@
|
|||||||
efiInstallAsRemovable = false;
|
efiInstallAsRemovable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
loader.timeout = 3; # wait for 3 seconds to select the boot entry
|
loader.timeout = lib.mkForce 3; # wait for 3 seconds to select the boot entry
|
||||||
initrd.availableKernelModules = ["uas" "virtio_blk" "virtio_pci"];
|
initrd.availableKernelModules = ["uas" "virtio_blk" "virtio_pci"];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -47,7 +51,6 @@
|
|||||||
};
|
};
|
||||||
# we do not have a /boot partition, so do not mount it.
|
# we do not have a /boot partition, so do not mount it.
|
||||||
|
|
||||||
|
|
||||||
# it alse had qemu-guest-agent installed by default.
|
# it alse had qemu-guest-agent installed by default.
|
||||||
services.qemuGuest.enable = lib.mkDefault true;
|
services.qemuGuest.enable = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{ ... }: {
|
{ username, ... }:
|
||||||
|
{
|
||||||
####################################################################
|
####################################################################
|
||||||
#
|
#
|
||||||
# NixOS's Configuration for Remote Building / Distributed Building
|
# NixOS's Configuration for Remote Building / Distributed Building
|
||||||
@@ -8,16 +8,16 @@
|
|||||||
# 1. https://github.com/NixOS/nix/issues/7380
|
# 1. https://github.com/NixOS/nix/issues/7380
|
||||||
# 2. https://nixos.wiki/wiki/Distributed_build
|
# 2. https://nixos.wiki/wiki/Distributed_build
|
||||||
# 3. https://github.com/NixOS/nix/issues/2589
|
# 3. https://github.com/NixOS/nix/issues/2589
|
||||||
|
#
|
||||||
####################################################################
|
####################################################################
|
||||||
|
|
||||||
# set local's max-job to 0 to force remote building(disable local building)
|
# set local's max-job to 0 to force remote building(disable local building)
|
||||||
# nix.settings.max-jobs = 0;
|
# nix.settings.max-jobs = 0;
|
||||||
nix.distributedBuilds = true;
|
nix.distributedBuilds = true;
|
||||||
nix.buildMachines =
|
nix.buildMachines = let
|
||||||
let
|
sshUser = username;
|
||||||
sshUser = "ryan";
|
|
||||||
# ssh key's path on local machine
|
# ssh key's path on local machine
|
||||||
sshKey = "/home/ryan/.ssh/ai-idols";
|
sshKey = "/home/${username}/.ssh/ai-idols";
|
||||||
systems = [
|
systems = [
|
||||||
# native arch
|
# native arch
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@@ -33,8 +33,7 @@
|
|||||||
"big-parallel"
|
"big-parallel"
|
||||||
"kvm"
|
"kvm"
|
||||||
];
|
];
|
||||||
in
|
in [
|
||||||
[
|
|
||||||
# Nix seems always try to build on the machine remotely
|
# Nix seems always try to build on the machine remotely
|
||||||
# to make use of the local machine's high-performance CPU, do not set remote builder's maxJobs too high.
|
# to make use of the local machine's high-performance CPU, do not set remote builder's maxJobs too high.
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
{ ... }:
|
{ username, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
nix.settings.trusted-users = ["ryan"];
|
nix.settings.trusted-users = [username];
|
||||||
|
|
||||||
users.groups = {
|
users.groups = {
|
||||||
ryan = { };
|
"${username}" = {};
|
||||||
docker = {};
|
docker = {};
|
||||||
wireshark = {};
|
wireshark = {};
|
||||||
};
|
};
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.ryan = {
|
users.users."${username}" = {
|
||||||
# the hashed password with salt is generated by run `mkpasswd`.
|
# the hashed password with salt is generated by run `mkpasswd`.
|
||||||
hashedPassword = "$y$j9T$YQu5vhlnogjDFDWp9QkPh0$Eu85OiwllqvLg5fzRVMLVHNO7InA3ro8grTJJIepyH1";
|
hashedPassword = "$y$j9T$YQu5vhlnogjDFDWp9QkPh0$Eu85OiwllqvLg5fzRVMLVHNO7InA3ro8grTJJIepyH1";
|
||||||
home = "/home/ryan";
|
home = "/home/${username}";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "ryan";
|
description = username;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"ryan"
|
username
|
||||||
"users"
|
"users"
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"wheel"
|
"wheel"
|
||||||
@@ -29,4 +29,21 @@
|
|||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDiipi59EnVbi6bK1bGrcbfEM263wgdNfbrt6VBC1rHx ryan@ai-idols"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDiipi59EnVbi6bK1bGrcbfEM263wgdNfbrt6VBC1rHx ryan@ai-idols"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# DO NOT promote the specified user to input password for `nix-store` and `nix-copy-closure`
|
||||||
|
security.sudo.extraRules = [
|
||||||
|
{
|
||||||
|
users = [username];
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
command = "/run/current-system/sw/bin/nix-store";
|
||||||
|
options = ["NOPASSWD"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
command = "/run/current-system/sw/bin/nix-copy-closure";
|
||||||
|
options = ["NOPASSWD"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ args:
|
|||||||
# execute and import all overlay files in the current directory with the given args
|
# execute and import all overlay files in the current directory with the given args
|
||||||
builtins.map
|
builtins.map
|
||||||
(f: (import (./. + "/${f}") args)) # execute and import the overlay file
|
(f: (import (./. + "/${f}") args)) # execute and import the overlay file
|
||||||
|
|
||||||
(builtins.filter # find all overlay files in the current directory
|
(builtins.filter # find all overlay files in the current directory
|
||||||
|
|
||||||
(f: f != "default.nix")
|
(f: f != "default.nix")
|
||||||
(builtins.attrNames (builtins.readDir ./.)))
|
(builtins.attrNames (builtins.readDir ./.)))
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# 为了不使用默认的 rime-data,改用我自定义的小鹤音形数据,这里需要 override
|
# 为了不使用默认的 rime-data,改用我自定义的小鹤音形数据,这里需要 override
|
||||||
# 参考 https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
|
# 参考 https://github.com/NixOS/nixpkgs/blob/e4246ae1e7f78b7087dce9c9da10d28d3725025f/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
|
||||||
{ ... }:
|
{...}: (self: super: {
|
||||||
|
|
||||||
(self: super: {
|
|
||||||
# 小鹤音形配置,配置来自 flypy.com 官方网盘的鼠须管配置压缩包「小鹤音形“鼠须管”for macOS.zip」
|
# 小鹤音形配置,配置来自 flypy.com 官方网盘的鼠须管配置压缩包「小鹤音形“鼠须管”for macOS.zip」
|
||||||
# 我仅修改了 default.yaml 文件,将其中的半角括号改为了直角括号「 与 」。
|
# 我仅修改了 default.yaml 文件,将其中的半角括号改为了直角括号「 与 」。
|
||||||
rime-data = ./rime-data-flypy;
|
rime-data = ./rime-data-flypy;
|
||||||
|
|||||||
+9
-5
@@ -1,7 +1,12 @@
|
|||||||
|
|
||||||
{ config, pkgs, agenix, mysecrets, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
agenix,
|
||||||
|
mysecrets,
|
||||||
|
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
agenix.darwinModules.default
|
agenix.darwinModules.default
|
||||||
];
|
];
|
||||||
@@ -12,7 +17,7 @@
|
|||||||
|
|
||||||
# if you changed this key, you need to regenerate all encrypt files from the decrypt contents!
|
# if you changed this key, you need to regenerate all encrypt files from the decrypt contents!
|
||||||
age.identityPaths = [
|
age.identityPaths = [
|
||||||
"/Users/ryan/.ssh/juliet-age" # macOS
|
"/Users/${username}/.ssh/juliet-age" # macOS
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
@@ -56,5 +61,4 @@
|
|||||||
system.activationScripts.postUserActivation.text = ''
|
system.activationScripts.postUserActivation.text = ''
|
||||||
sudo chmod 644 /etc/agenix/*
|
sudo chmod 644 /etc/agenix/*
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-4
@@ -1,7 +1,12 @@
|
|||||||
|
|
||||||
{ config, pkgs, agenix, mysecrets, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
agenix,
|
||||||
|
mysecrets,
|
||||||
|
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
];
|
];
|
||||||
@@ -12,7 +17,7 @@
|
|||||||
|
|
||||||
# if you changed this key, you need to regenerate all encrypt files from the decrypt contents!
|
# if you changed this key, you need to regenerate all encrypt files from the decrypt contents!
|
||||||
age.identityPaths = [
|
age.identityPaths = [
|
||||||
"/home/ryan/.ssh/juliet-age" # Linux
|
"/home/${username}/.ssh/juliet-age" # Linux
|
||||||
];
|
];
|
||||||
|
|
||||||
# Used only by NixOS Modules
|
# Used only by NixOS Modules
|
||||||
|
|||||||
Reference in New Issue
Block a user