refactor: what can I say

This commit is contained in:
2025-04-19 12:42:19 +08:00
parent d34da2b672
commit 2242e26ede
51 changed files with 211 additions and 332 deletions

View File

@@ -3,7 +3,7 @@ keys:
- &imxyy-nix-server age1hpgg6psejh4y6jcdd34wxuml75fnweqpe0kh8376yqsctsfn9qxs037kk6 - &imxyy-nix-server age1hpgg6psejh4y6jcdd34wxuml75fnweqpe0kh8376yqsctsfn9qxs037kk6
- &imxyy-cloudwin age1tp7th3rrv3x0l6jl76n0hjqjp223w2y586pkgr0hcjwdm254jd5shkj6a8 - &imxyy-cloudwin age1tp7th3rrv3x0l6jl76n0hjqjp223w2y586pkgr0hcjwdm254jd5shkj6a8
creation_rules: creation_rules:
- path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt)$ - path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt|conf)$
key_groups: key_groups:
- age: - age:
- *imxyy-nix - *imxyy-nix

View File

@@ -1,13 +1,18 @@
{ lib, hostname, ... }: { config, hostname, ... }:
{ {
# I prefer this to the default issue text
# ported from ArchLinux IIRC
environment.etc.issue.text = "\\e{lightcyan}\\S\\e{reset} Login (\\l)\n\n"; environment.etc.issue.text = "\\e{lightcyan}\\S\\e{reset} Login (\\l)\n\n";
networking.hostName = hostname; networking.hostName = hostname;
# don't change this unless you know what you are doing!
# for further information, see wiki.nixos.org
system.stateVersion = "24.11"; system.stateVersion = "24.11";
systemd.services."systemd-machine-id-commit".enable = lib.mkForce false; # disable this since we already have machine-id persisted
systemd.services."systemd-machine-id-commit".enable = !config.my.persist.enable;
my = { my = {
home = { home = {
# Nicely reload system units when changing configs # nicely reload system units when changing configs
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";
home.stateVersion = "24.11"; home.stateVersion = "24.11";
}; };

View File

@@ -4,7 +4,9 @@
pkgs, pkgs,
... ...
}: }:
let
btrfs = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
in
{ {
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
@@ -29,7 +31,7 @@
networking.hostId = "10ca95b4"; networking.hostId = "10ca95b4";
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0"; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"compress=zstd" "compress=zstd"
@@ -38,7 +40,7 @@
}; };
fileSystems."/nix" = { fileSystems."/nix" = {
device = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0"; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"compress=zstd" "compress=zstd"
@@ -47,7 +49,7 @@
}; };
fileSystems."/persistent" = { fileSystems."/persistent" = {
device = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0"; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"compress=zstd" "compress=zstd"
@@ -58,7 +60,7 @@
boot.initrd.postDeviceCommands = lib.mkAfter '' boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp mkdir /btrfs_tmp
mount /dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0 /btrfs_tmp mount ${btrfs} /btrfs_tmp
mkdir -p /btrfs_tmp/old_roots mkdir -p /btrfs_tmp/old_roots
if [[ -e /btrfs_tmp/root ]]; then if [[ -e /btrfs_tmp/root ]]; then
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
@@ -84,6 +86,12 @@
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/32AA-2998"; device = "/dev/disk/by-uuid/32AA-2998";
fsType = "vfat"; fsType = "vfat";
options = [
"uid=0"
"gid=0"
"fmask=0077"
"dmask=0077"
];
}; };
# 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

View File

@@ -11,7 +11,7 @@
}; };
}; };
my = { my = {
cmd.all.enable = true; cli.all.enable = true;
coding.editor.neovim.enable = true; coding.editor.neovim.enable = true;
coding.misc.enable = true; coding.misc.enable = true;
coding.langs.lua.enable = true; coding.langs.lua.enable = true;

View File

@@ -7,8 +7,8 @@
sops.sshKeyPath = "/home/${username}/.ssh/id_ed25519"; sops.sshKeyPath = "/home/${username}/.ssh/id_ed25519";
coding.all.enable = true; coding.all.enable = true;
coding.editor.vscode.enable = lib.mkForce false; coding.editor.vscode.enable = lib.mkForce false;
cmd.misc.enable = true; cli.misc.enable = true;
xdg.enable = true; xdg.enable = true;
cmd.media.all.enable = true; cli.media.all.enable = true;
}; };
} }

View File

@@ -4,7 +4,7 @@
nixos-wsl.nixosModules.wsl nixos-wsl.nixosModules.wsl
]; ];
wsl.enable = true; wsl.enable = true;
wsl.defaultUser = "${username}"; wsl.defaultUser = username;
services.openssh = { services.openssh = {
enable = true; enable = true;

View File

@@ -5,7 +5,9 @@
username, username,
... ...
}: }:
let
btrfs = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
in
{ {
boot = { boot = {
initrd = { initrd = {
@@ -29,27 +31,14 @@
"fs.file-max" = 9223372036854775807; "fs.file-max" = 9223372036854775807;
}; };
resumeDevice = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c"; resumeDevice = btrfs;
kernelParams = [ kernelParams = [
"resume_offset=6444127" "resume_offset=6444127"
# "quiet"
# "splash"
# "log_level=3"
]; ];
consoleLogLevel = 3;
/*
plymouth = {
enable = true;
theme = "bgrt";
themePackages = [ pkgs.nixos-bgrt-plymouth ];
};
*/
}; };
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c"; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"compress=zstd" "compress=zstd"
@@ -64,7 +53,7 @@
}; };
fileSystems."/persistent" = { fileSystems."/persistent" = {
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c"; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"compress=zstd" "compress=zstd"
@@ -74,7 +63,7 @@
}; };
fileSystems."/swap" = { fileSystems."/swap" = {
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c"; device = btrfs;
fsType = "btrfs"; fsType = "btrfs";
options = [ options = [
"compress=zstd" "compress=zstd"
@@ -85,7 +74,7 @@
boot.initrd.postDeviceCommands = lib.mkAfter '' boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp mkdir /btrfs_tmp
mount /dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c /btrfs_tmp mount ${btrfs} /btrfs_tmp
mkdir -p /btrfs_tmp/old_roots mkdir -p /btrfs_tmp/old_roots
if [[ -e /btrfs_tmp/root ]]; then if [[ -e /btrfs_tmp/root ]]; then
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
@@ -111,6 +100,12 @@
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B7DC-E9AC"; device = "/dev/disk/by-uuid/B7DC-E9AC";
fsType = "vfat"; fsType = "vfat";
options = [
"uid=0"
"gid=0"
"fmask=0077"
"dmask=0077"
];
}; };
fileSystems."/home/${username}/Documents" = { fileSystems."/home/${username}/Documents" = {

View File

@@ -15,7 +15,6 @@
wpsoffice-cn wpsoffice-cn
wps-office-fonts wps-office-fonts
evince evince
# siyuan-unlock
anki anki
@@ -53,7 +52,8 @@
''; '';
}; };
programs.niri.settings.outputs = { programs.niri.settings = {
outputs = {
DP-2 = { DP-2 = {
enable = true; enable = true;
mode = { mode = {
@@ -77,12 +77,22 @@
scale = 1.25; scale = 1.25;
}; };
}; };
spawn-at-startup = [
{
command = [
"sh"
"-c"
"sleep 3; echo 'Xft.dpi: 120' | ${lib.getExe pkgs.xorg.xrdb} -merge"
];
}
];
}; };
};
my = { my = {
autologin = { autologin = {
enable = true; enable = true;
user = "${username}"; user = username;
ttys = [ ttys = [
1 1
6 6
@@ -90,12 +100,10 @@
}; };
gpg.enable = true; gpg.enable = true;
cmd.all.enable = true; cli.all.enable = true;
coding.all.enable = true; coding.all.enable = true;
desktop.all.enable = true; desktop.all.enable = true;
desktop.wm.dwm.enable = lib.mkForce false;
desktop.browser.librewolf.enable = lib.mkForce false; desktop.browser.librewolf.enable = lib.mkForce false;
i18n.fcitx5.enable = true; i18n.fcitx5.enable = true;
@@ -207,9 +215,6 @@
".config/go-musicfox/cookie" ".config/go-musicfox/cookie"
".hmcl.json" ".hmcl.json"
]; ];
nixosFiles = [
"/etc/davfs2/secrets"
];
}; };
}; };
} }

View File

@@ -1,7 +1,9 @@
{ {
lib, lib,
pkgs, pkgs,
config,
username, username,
sopsRoot,
... ...
}: }:
let let
@@ -266,24 +268,11 @@ in
btreset btreset
]; ];
fileSystems = sops.secrets.imxyy-nix-rclone = {
let sopsFile = sopsRoot + /imxyy-nix-rclone.conf;
config = pkgs.writeText "rclone.conf" '' format = "binary";
[Nextcloud] };
type = webdav fileSystems = {
url = https://192.168.3.2/remote.php/dav/files/imxyy_soope_
vendor = nextcloud
user = imxyy_soope_
pass = C2UUiMyPoynWWKS9kf_Fr8rcoXxgUswPYi4s
[NAS]
type = smb
host = 192.168.3.2
user = nas
pass = O74S6-7jDFykwCvZ8vuIxohh00Ty7XJF
'';
in
{
"/home/${username}/Nextcloud" = { "/home/${username}/Nextcloud" = {
device = "Nextcloud:"; device = "Nextcloud:";
fsType = "rclone"; fsType = "rclone";
@@ -292,7 +281,7 @@ in
"nofail" "nofail"
"allow_other" "allow_other"
"args2env" "args2env"
"config=${toString config}" "config=${config.sops.secrets.imxyy-nix-rclone.path}"
"uid=1000" "uid=1000"
"gid=100" "gid=100"
"rw" "rw"

View File

@@ -1,35 +0,0 @@
{
"version": 1,
"rules": [
{
"domain": [
"cm.steampowered.com",
"ol.epicgames.com",
"csgo.wmsj.cn",
"dota2.wmsj.cn",
"wmsjsteam.com",
"dl.steam.clngaa.com",
"dl.steam.ksyna.com",
"gstore.val.manlaxy.com",
"st.dl.bscstorage.net",
"st.dl.eccdnx.com",
"st.dl.pinyuncloud.com",
"steampipe.steamcontent.tnkjmec.com",
"steampowered.com.8686c.com",
"steamstatic.com.8686c.com",
"steambroadcast.akamaized.net",
"steamcdn-a.akamaihd.net",
"steamcommunity-a.akamaihd.net",
"steamstore-a.akamaihd.net",
"steamusercontent-a.akamaihd.net",
"steamuserimages-a.akamaihd.net"
],
"domain_suffix": [
".steamcontent.com",
".steamserver.net",
".steamchina.com"
],
"invert": false
}
]
}

View File

@@ -1,11 +0,0 @@
#!/bin/sh
sudo mkdir -p /run/systemd/system/docker.service.d
sudo su -c 'cat << EOF >/run/systemd/system/docker.service.d/override.conf
[Service]
Environment="http_proxy=http://127.0.0.1:7890"
Environment="https_proxy=http://127.0.0.1:7890"
Environment="all_proxy=socks5h://127.0.0.1:7891"
EOF'
sudo systemctl daemon-reload
sudo systemctl restart docker

78
flake.lock generated
View File

@@ -140,28 +140,6 @@
"type": "github" "type": "github"
} }
}, },
"dwm": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1703321746,
"narHash": "sha256-W6wBfx8LmyAFY7jEAlol6A9kvDpC9QqxNAJfvAxIm8A=",
"owner": "imxyy1soope1",
"repo": "dwm",
"rev": "d38da01cf2957ddac8cd827c84aab076f1555daf",
"type": "github"
},
"original": {
"owner": "imxyy1soope1",
"ref": "master",
"repo": "dwm",
"type": "github"
}
},
"fenix": { "fenix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -349,11 +327,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1710146030,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -367,11 +345,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1731533236,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -399,24 +377,6 @@
} }
}, },
"flake-utils_4": { "flake-utils_4": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"inputs": { "inputs": {
"systems": [ "systems": [
"stylix", "stylix",
@@ -797,7 +757,7 @@
}, },
"nix-vscode-extensions": { "nix-vscode-extensions": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
@@ -816,7 +776,7 @@
}, },
"nix2container": { "nix2container": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"go-musicfox", "go-musicfox",
"nixpkgs" "nixpkgs"
@@ -1042,7 +1002,7 @@
}, },
"omz": { "omz": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@@ -1085,7 +1045,6 @@
"root": { "root": {
"inputs": { "inputs": {
"darkly": "darkly", "darkly": "darkly",
"dwm": "dwm",
"fenix": "fenix", "fenix": "fenix",
"go-musicfox": "go-musicfox", "go-musicfox": "go-musicfox",
"home-manager": "home-manager", "home-manager": "home-manager",
@@ -1151,7 +1110,7 @@
"base16-vim": "base16-vim", "base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme", "firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_4",
"git-hooks": "git-hooks_2", "git-hooks": "git-hooks_2",
"gnome-shell": "gnome-shell", "gnome-shell": "gnome-shell",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
@@ -1159,7 +1118,7 @@
"nixpkgs" "nixpkgs"
], ],
"nur": "nur_2", "nur": "nur_2",
"systems": "systems_5", "systems": "systems_4",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
@@ -1240,21 +1199,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@@ -33,10 +33,6 @@
omz.url = "github:imxyy1soope1/omz/master"; omz.url = "github:imxyy1soope1/omz/master";
omz.inputs.nixpkgs.follows = "nixpkgs"; omz.inputs.nixpkgs.follows = "nixpkgs";
# dwm
dwm.url = "github:imxyy1soope1/dwm/master";
dwm.inputs.nixpkgs.follows = "nixpkgs";
# Niri # Niri
niri.url = "github:sodiboo/niri-flake"; niri.url = "github:sodiboo/niri-flake";
niri.inputs.nixpkgs.follows = "nixpkgs"; niri.inputs.nixpkgs.follows = "nixpkgs";
@@ -75,18 +71,17 @@
variables = import ./variables.nix; variables = import ./variables.nix;
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
forAllHosts = forAllHosts =
gen: mkSystem:
nixpkgs.lib.attrsets.mergeAttrsList ( nixpkgs.lib.attrsets.mergeAttrsList (
builtins.map ( builtins.map (hostname: {
{ hostname, ... }@host: ${hostname} = mkSystem hostname;
{ }) (builtins.attrNames (builtins.readDir ./config/hosts))
${hostname} = gen host;
}
) variables.hosts
); );
in in
{ {
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# workaround for "treefmt warning"
formatter = forAllSystems ( formatter = forAllSystems (
system: system:
let let
@@ -95,9 +90,9 @@
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "nixfmt-wrapper"; name = "nixfmt-wrapper";
runtimeInputs = [ runtimeInputs = with pkgs; [
pkgs.fd fd
pkgs.nixfmt-rfc-style nixfmt-rfc-style
]; ];
text = '' text = ''
@@ -108,9 +103,8 @@
overlays = import ./overlays { inherit inputs; }; overlays = import ./overlays { inherit inputs; };
# Available through 'nixos-rebuild --flake .#{hostname}'
nixosConfigurations = forAllHosts ( nixosConfigurations = forAllHosts (
{ hostname, system }: hostname:
let let
lib = import ./lib/stdlib-extended.nix ( lib = import ./lib/stdlib-extended.nix (
nixpkgs.lib.extend ( nixpkgs.lib.extend (
@@ -122,9 +116,7 @@
overlays = builtins.attrValues self.overlays ++ [ overlays = builtins.attrValues self.overlays ++ [
inputs.go-musicfox.overlays.default inputs.go-musicfox.overlays.default
inputs.omz.overlays.default inputs.omz.overlays.default
inputs.dwm.overlays.default
inputs.niri.overlays.niri inputs.niri.overlays.niri
# inputs.neovim-nightly.overlays.default
inputs.fenix.overlays.default inputs.fenix.overlays.default
inputs.nix-vscode-extensions.overlays.default inputs.nix-vscode-extensions.overlays.default
(final: prev: { (final: prev: {
@@ -143,10 +135,27 @@
}; };
}) })
]; ];
pkgs = import nixpkgs { home = {
inherit system overlays; home-manager = {
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.impermanence.nixosModules.home-manager.impermanence
inputs.stylix.homeManagerModules.stylix
inputs.niri.homeModules.niri
# workaround for annoying stylix
{
nixpkgs.overlays = lib.mkForce null;
}
];
useGlobalPkgs = true;
};
};
pkgsConf.nixpkgs = {
overlays = lib.mkForce overlays;
config.allowUnfree = true; config.allowUnfree = true;
}; };
in
lib.nixosSystem {
specialArgs = { specialArgs = {
inherit (variables) inherit (variables)
username username
@@ -159,45 +168,20 @@
inputs inputs
outputs outputs
nixos-wsl nixos-wsl
system
hostname hostname
; ;
sopsRoot = ./secrets; sopsRoot = ./secrets;
}; };
in
lib.nixosSystem {
inherit specialArgs;
modules = [ modules = [
./modules ./modules
./config/base.nix ./config/base.nix
./config/hosts/${hostname} ./config/hosts/${hostname}
{
nixpkgs = {
inherit pkgs;
};
}
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
{ home
home-manager = { pkgsConf
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.impermanence.nixosModules.home-manager.impermanence
inputs.stylix.homeManagerModules.stylix
inputs.niri.homeModules.niri
(
{ lib, ... }:
{
nixpkgs.overlays = lib.mkForce null;
}
)
];
useGlobalPkgs = true;
};
}
]; ];
} }
); );

View File

@@ -3,11 +3,11 @@ lib.my.makeSwitch {
inherit config; inherit config;
optionName = "all command line tools"; optionName = "all command line tools";
optionPath = [ optionPath = [
"cmd" "cli"
"all" "all"
]; ];
config' = { config' = {
my.cmd = { my.cli = {
media.all.enable = true; media.all.enable = true;
misc.enable = true; misc.enable = true;
monitor.all.enable = true; monitor.all.enable = true;

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config; inherit config;
optionName = "all command line media tools"; optionName = "all command line media tools";
optionPath = [ optionPath = [
"cmd" "cli"
"media" "media"
"all" "all"
]; ];
config' = { config' = {
my.cmd.media = { my.cli.media = {
cava.enable = true; cava.enable = true;
go-musicfox.enable = true; go-musicfox.enable = true;
mpd.enable = true; mpd.enable = true;

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "cava"; packageName = "cava";
packagePath = [ "cava" ]; packagePath = [ "cava" ];
optionPath = [ optionPath = [
"cmd" "cli"
"media" "media"
"cava" "cava"
]; ];

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "ffmpeg"; packageName = "ffmpeg";
packagePath = [ "ffmpeg" ]; packagePath = [ "ffmpeg" ];
optionPath = [ optionPath = [
"cmd" "cli"
"media" "media"
"ffmpeg" "ffmpeg"
]; ];

View File

@@ -8,7 +8,7 @@ lib.my.makeSwitch {
inherit config; inherit config;
optionName = "go-musicfox"; optionName = "go-musicfox";
optionPath = [ optionPath = [
"cmd" "cli"
"media" "media"
"go-musicfox" "go-musicfox"
]; ];
@@ -22,7 +22,7 @@ lib.my.makeSwitch {
xdg.configFile."go-musicfox/go-musicfox.ini".source = ./go-musicfox.ini; xdg.configFile."go-musicfox/go-musicfox.ini".source = ./go-musicfox.ini;
}; };
cmd.media.mpd.enable = true; cli.media.mpd.enable = true;
}; };
}; };
} }

View File

@@ -8,7 +8,7 @@ lib.my.makeSwitch {
inherit config; inherit config;
optionName = "mpd"; optionName = "mpd";
optionPath = [ optionPath = [
"cmd" "cli"
"media" "media"
"mpd" "mpd"
]; ];

View File

@@ -11,7 +11,7 @@ lib.my.makeSwitch {
default = true; default = true;
optionName = "misc command line tools"; optionName = "misc command line tools";
optionPath = [ optionPath = [
"cmd" "cli"
"misc" "misc"
]; ];
config' = { config' = {

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config; inherit config;
optionName = "all command line monitor tools"; optionName = "all command line monitor tools";
optionPath = [ optionPath = [
"cmd" "cli"
"monitor" "monitor"
"all" "all"
]; ];
config' = { config' = {
my.cmd.monitor = { my.cli.monitor = {
btop.enable = true; btop.enable = true;
}; };
}; };

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "btop"; packageName = "btop";
packagePath = [ "btop" ]; packagePath = [ "btop" ];
optionPath = [ optionPath = [
"cmd" "cli"
"monitor" "monitor"
"btop" "btop"
]; ];

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config; inherit config;
optionName = "all shells"; optionName = "all shells";
optionPath = [ optionPath = [
"cmd" "cli"
"shell" "shell"
"all" "all"
]; ];
config' = { config' = {
my.cmd.shell = { my.cli.shell = {
zsh.enable = true; zsh.enable = true;
}; };
}; };

View File

@@ -9,7 +9,7 @@ lib.my.makeSwitch {
default = true; default = true;
optionName = "default zsh settings"; optionName = "default zsh settings";
optionPath = [ optionPath = [
"cmd" "cli"
"shell" "shell"
"zsh" "zsh"
]; ];

View File

@@ -5,7 +5,7 @@
}: }:
{ {
imports = [ imports = [
./cmd ./cli
./coding ./coding
./virt ./virt
./desktop ./desktop

View File

@@ -14,7 +14,6 @@ lib.my.makeSwitch {
config' = { config' = {
my.desktop.wm = { my.desktop.wm = {
cage.enable = true; cage.enable = true;
dwm.enable = true;
niri.enable = true; niri.enable = true;
}; };
}; };

View File

@@ -3,7 +3,6 @@
imports = [ imports = [
./all.nix ./all.nix
./cage.nix ./cage.nix
./dwm.nix
./niri ./niri
]; ];
} }

View File

@@ -1,16 +0,0 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "dwm";
packagePath = [ "dwm" ];
optionPath = [
"desktop"
"wm"
"dwm"
];
}

View File

@@ -5,7 +5,10 @@
... ...
}: }:
{ {
my.home.systemd.user.services.swaync.Unit.After = [ "graphical-session.target" ]; my.home.systemd.user.services.swaync = {
Unit.After = [ "graphical-session.target" ];
Service.ExecStart = [ "swaync" ];
};
my.home.programs.niri.settings = { my.home.programs.niri.settings = {
input = { input = {

View File

@@ -20,6 +20,11 @@ lib.my.makeSwitch {
# Making legacy nix commands consistent as well, awesome! # Making legacy nix commands consistent as well, awesome!
nix.nixPath = [ "/etc/nix/path" ]; nix.nixPath = [ "/etc/nix/path" ];
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
nix.settings = { nix.settings = {
# Enable flakes and new 'nix' command # Enable flakes and new 'nix' command
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
@@ -38,6 +43,7 @@ lib.my.makeSwitch {
]; ];
}; };
# uncomment to enable auto gc
/* /*
nix.gc = { nix.gc = {
automatic = true; automatic = true;
@@ -45,10 +51,5 @@ lib.my.makeSwitch {
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };
*/ */
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
}; };
} }

View File

@@ -24,7 +24,7 @@ lib.my.makeSwitch {
mutableUsers = false; mutableUsers = false;
users.${username} = { users.${username} = {
isNormalUser = true; isNormalUser = true;
description = "${userdesc}"; description = userdesc;
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ extraGroups = [
"wheel" "wheel"
@@ -38,7 +38,7 @@ lib.my.makeSwitch {
security.sudo.extraRules = [ security.sudo.extraRules = [
{ {
users = [ "${username}" ]; users = [ username ];
commands = [ commands = [
{ {
command = "ALL"; command = "ALL";
@@ -50,7 +50,7 @@ lib.my.makeSwitch {
nix.settings.trusted-users = [ nix.settings.trusted-users = [
"root" "root"
"${username}" username
]; ];
my.home = { my.home = {

View File

@@ -1,7 +1,5 @@
# This file defines overlays
{ inputs, ... }: { inputs, ... }:
{ {
# This one brings our custom packages from the 'pkgs' directory
additions = final: prev: import ../pkgs prev; additions = final: prev: import ../pkgs prev;
modifications = final: prev: { modifications = final: prev: {
@@ -15,11 +13,10 @@
) )
''; '';
}; };
easytier = final.master.easytier;
}; };
# When applied, the unstable nixpkgs set (declared in the flake inputs) will # this allows us to access specific version of nixpkgs
# be accessible through 'pkgs.unstable' # by `pkgs.unstable`, `pkgs.stable` and `pkgs.master`
unstable-packages = final: _prev: { unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable { unstable = import inputs.nixpkgs-unstable {
system = final.system; system = final.system;

View File

@@ -9,7 +9,7 @@ stdenvNoCC.mkDerivation rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "soimort"; owner = "soimort";
repo = "${pname}"; repo = pname;
rev = "gh-pages"; rev = "gh-pages";
hash = "sha256-YQevXwslWzHen9n+Fn0a+oNx/EKg0Kd/Ge8ksYP0ekY="; hash = "sha256-YQevXwslWzHen9n+Fn0a+oNx/EKg0Kd/Ge8ksYP0ekY=";
}; };

View File

@@ -0,0 +1,23 @@
{
"data": "ENC[AES256_GCM,data:H5CGsFM58ivxF2x4RSSU7frD44nsrVh55493Icy6WhaSeLhTTfxfoweSXm5WYSvHorA9wiTLA0VljML1kj0+wTJM+A3PqpaU81uE3V33GNzLpDZw7B0dHtNrX/9C1TC574rOsI3w+6PVA+NpGJs4ROcNouHDIrDxuSlyie7lZwW1f/VikELIx73LMMJfqL50+LKgQpvey7jz0rLMjv1nRg484LoepXd3s/dVZD6DzBY49CSu6OZzpq49LxLgiKSMorgOFhfffbsuBto2zfw1J28cgzFjiIfKp+38mhK/LHSuT9GIXqavH7CoHPAqy1hfbkLc1P4m2FdAFcF5Db0tg6E=,iv:tP9AFJRuRoRe/fNjen7wNAglPydILlW6+BEbS8VoTmw=,tag:68VCpplQp0vZ/oW/h53poQ==,type:str]",
"sops": {
"age": [
{
"recipient": "age1jf5pg2x6ta8amj40xdy0stvcvrdlkwc2nrwtmkpymu0qclk0eg5qmm9kns",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5RlZrOURPOEtrTmVFdWwr\nZXJRNjBjNjAxVmx2VVduMCsyRDZ5N2dWZTJVCi9KWlJTZHFpaC9XSkZobWFhOWxi\nSUJ6bnZQRG5ZRUJrUW04TjRpUXZSUGMKLS0tIGs1WERFdG4xTVNoOGh0ck5lUStC\neUdtOWZKNjZ2dFlLQ2phZWdnV3p4T0EKk1OEs50o7zY6sYsD5IdY7nQ2Rzt5qKvN\nZbVA6tNMFU+X0Pleie1JPY94FvIgY59we/NSvCK69Iwx9xHe2Fpx+g==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1hpgg6psejh4y6jcdd34wxuml75fnweqpe0kh8376yqsctsfn9qxs037kk6",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6Z1B5QXlYR2dEOFhBRXpT\ncmpqQ25kZ2VnWjlOckNiMy82NVdDZmVKUFQ0CnRSRTVDQlI0TlZVUjBKYy82WURj\nVlk2UVhrM0thamRPV0lKRFBkUllERjgKLS0tIHpoOE1jNnRZdUlBTXZFUnFBNGFK\nalVvTU5qUUZKc1B0V24ySldZUW5zbkUK2LRfzrJRX69qPQf+V2NxCatBZYwQm4lA\n6SnWh8fnk3rb+oipBzcb9OHxiG5nNvlbYfFv675l189OKJmgGIIZug==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1tp7th3rrv3x0l6jl76n0hjqjp223w2y586pkgr0hcjwdm254jd5shkj6a8",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxVFpjMVpIWEY1UFR6RHFl\ndE9wbktIeG1qSERQTWw4ZVJ5ci9wM2Q0djJNCjNmTndqUWxVVTE3RlFkMkpRUi9m\nNWhBOEtGNVd0cEVXRWVQRnMwZmNUUU0KLS0tIDR1VmNJZXU0UkdlLzcwd3NDelRn\nOXgrSTQrNSt0a0VGN3FZaW0xN0hDM0EK4rHhgHBpImc5zhbJvHJHy+wWAywYLpLz\nLThnCQ2kVxiyucYVBe1Imy6mWI5jTOTTw450kCf5wXrwUp+yGmwnaA==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-04-19T02:58:06Z",
"mac": "ENC[AES256_GCM,data:TEwHcXhV76VyQf7lzaP7I7LKfcOKWhgdt3bemfO/M7/ZLEc8A8tCN1SGjH5hpOMCJEx4Pws0pcY+EqjlWmA8q4eSR2mZNGGrFsCJCfQJSwpicD0/IDEUNfdSoygmjtyvnnYfioxqbvPc64eR9emG2DedvLKvWeZ5ZmvfZ8ujP+8=,iv:VkvwOTAznJsO4PaD+b0wCxDJN5mSMrjqVT4bZ7EQrvI=,tag:JBOomz0dAX18HDxwM2jyeg==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.1"
}
}

View File

@@ -23,7 +23,7 @@ rec {
in in
[ [
{ {
hostname = "${hostprefix}"; hostname = hostprefix;
system = x86_64.linux; system = x86_64.linux;
} }
{ {

View File

@@ -1,11 +0,0 @@
#!/bin/sh
sudo mkdir -p /run/systemd/system/nix-daemon.service.d
sudo su -c 'cat << EOF >/run/systemd/system/nix-daemon.service.d/override.conf
[Service]
Environment="http_proxy=http://192.168.128.1:7890"
Environment="https_proxy=http://192.168.128.1:7890"
Environment="all_proxy=socks5h://192.168.128.1:7890"
EOF'
sudo systemctl daemon-reload
sudo systemctl restart nix-daemon