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-cloudwin age1tp7th3rrv3x0l6jl76n0hjqjp223w2y586pkgr0hcjwdm254jd5shkj6a8
creation_rules:
- path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt)$
- path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt|conf)$
key_groups:
- age:
- *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";
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";
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 = {
home = {
# Nicely reload system units when changing configs
# nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
home.stateVersion = "24.11";
};

View File

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

View File

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

View File

@@ -7,8 +7,8 @@
sops.sshKeyPath = "/home/${username}/.ssh/id_ed25519";
coding.all.enable = true;
coding.editor.vscode.enable = lib.mkForce false;
cmd.misc.enable = true;
cli.misc.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
];
wsl.enable = true;
wsl.defaultUser = "${username}";
wsl.defaultUser = username;
services.openssh = {
enable = true;

View File

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

View File

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

View File

@@ -1,7 +1,9 @@
{
lib,
pkgs,
config,
username,
sopsRoot,
...
}:
let
@@ -266,54 +268,41 @@ in
btreset
];
fileSystems =
let
config = pkgs.writeText "rclone.conf" ''
[Nextcloud]
type = webdav
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" = {
device = "Nextcloud:";
fsType = "rclone";
options = [
"nodev"
"nofail"
"allow_other"
"args2env"
"config=${toString config}"
"uid=1000"
"gid=100"
"rw"
"no-check-certificate"
"vfs-cache-mode=full"
];
};
"/home/${username}/NAS" = {
device = "//192.168.3.2/share";
fsType = "cifs";
options = [
"username=nas"
"password=nasshare"
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"
"nodev"
"nofail"
"uid=1000"
"gid=100"
"vers=3"
"rw"
];
};
sops.secrets.imxyy-nix-rclone = {
sopsFile = sopsRoot + /imxyy-nix-rclone.conf;
format = "binary";
};
fileSystems = {
"/home/${username}/Nextcloud" = {
device = "Nextcloud:";
fsType = "rclone";
options = [
"nodev"
"nofail"
"allow_other"
"args2env"
"config=${config.sops.secrets.imxyy-nix-rclone.path}"
"uid=1000"
"gid=100"
"rw"
"no-check-certificate"
"vfs-cache-mode=full"
];
};
"/home/${username}/NAS" = {
device = "//192.168.3.2/share";
fsType = "cifs";
options = [
"username=nas"
"password=nasshare"
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"
"nodev"
"nofail"
"uid=1000"
"gid=100"
"vers=3"
"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"
}
},
"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": {
"inputs": {
"nixpkgs": [
@@ -349,11 +327,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@@ -367,11 +345,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@@ -399,24 +377,6 @@
}
},
"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": {
"systems": [
"stylix",
@@ -797,7 +757,7 @@
},
"nix-vscode-extensions": {
"inputs": {
"flake-utils": "flake-utils_3",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_4"
},
"locked": {
@@ -816,7 +776,7 @@
},
"nix2container": {
"inputs": {
"flake-utils": "flake-utils_2",
"flake-utils": "flake-utils",
"nixpkgs": [
"go-musicfox",
"nixpkgs"
@@ -1042,7 +1002,7 @@
},
"omz": {
"inputs": {
"flake-utils": "flake-utils_4",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
@@ -1085,7 +1045,6 @@
"root": {
"inputs": {
"darkly": "darkly",
"dwm": "dwm",
"fenix": "fenix",
"go-musicfox": "go-musicfox",
"home-manager": "home-manager",
@@ -1151,7 +1110,7 @@
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_5",
"flake-utils": "flake-utils_4",
"git-hooks": "git-hooks_2",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
@@ -1159,7 +1118,7 @@
"nixpkgs"
],
"nur": "nur_2",
"systems": "systems_5",
"systems": "systems_4",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
@@ -1240,21 +1199,6 @@
"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": {
"flake": false,
"locked": {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,7 +8,7 @@ lib.my.makeSwitch {
inherit config;
optionName = "go-musicfox";
optionPath = [
"cmd"
"cli"
"media"
"go-musicfox"
];
@@ -22,7 +22,7 @@ lib.my.makeSwitch {
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;
optionName = "mpd";
optionPath = [
"cmd"
"cli"
"media"
"mpd"
];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -3,7 +3,6 @@
imports = [
./all.nix
./cage.nix
./dwm.nix
./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 = {
input = {

View File

@@ -20,6 +20,11 @@ lib.my.makeSwitch {
# Making legacy nix commands consistent as well, awesome!
nix.nixPath = [ "/etc/nix/path" ];
environment.etc = lib.mapAttrs' (name: value: {
name = "nix/path/${name}";
value.source = value.flake;
}) config.nix.registry;
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
@@ -38,6 +43,7 @@ lib.my.makeSwitch {
];
};
# uncomment to enable auto gc
/*
nix.gc = {
automatic = true;
@@ -45,10 +51,5 @@ lib.my.makeSwitch {
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;
users.${username} = {
isNormalUser = true;
description = "${userdesc}";
description = userdesc;
shell = pkgs.zsh;
extraGroups = [
"wheel"
@@ -38,7 +38,7 @@ lib.my.makeSwitch {
security.sudo.extraRules = [
{
users = [ "${username}" ];
users = [ username ];
commands = [
{
command = "ALL";
@@ -50,7 +50,7 @@ lib.my.makeSwitch {
nix.settings.trusted-users = [
"root"
"${username}"
username
];
my.home = {

View File

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

View File

@@ -9,7 +9,7 @@ stdenvNoCC.mkDerivation rec {
src = fetchFromGitHub {
owner = "soimort";
repo = "${pname}";
repo = pname;
rev = "gh-pages";
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
[
{
hostname = "${hostprefix}";
hostname = hostprefix;
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