From 2242e26edea5e856e8c7ab923d63221bd665bc2e Mon Sep 17 00:00:00 2001 From: imxyy_soope_ Date: Sat, 19 Apr 2025 12:42:19 +0800 Subject: [PATCH] refactor: what can I say --- .sops.yaml | 2 +- config/base.nix | 11 ++- config/hosts/imxyy-nix-server/hardware.nix | 18 ++-- config/hosts/imxyy-nix-server/home.nix | 2 +- config/hosts/imxyy-nix-wsl/home.nix | 4 +- config/hosts/imxyy-nix-wsl/nixos.nix | 2 +- config/hosts/imxyy-nix/hardware.nix | 33 +++---- config/hosts/imxyy-nix/home.nix | 63 +++++++------- config/hosts/imxyy-nix/nixos.nix | 87 ++++++++----------- config/hosts/imxyy-nix/rule_sets/steamcn.json | 35 -------- docker_proxy.sh | 11 --- flake.lock | 78 +++-------------- flake.nix | 78 +++++++---------- modules/{cmd => cli}/all.nix | 4 +- modules/{cmd => cli}/default.nix | 0 modules/{cmd => cli}/media/all.nix | 4 +- modules/{cmd => cli}/media/cava/config/config | 0 .../media/cava/config/config-applet | 0 .../cava/config/shaders/bar_spectrum.frag | 0 .../cava/config/shaders/normalized_bars.frag | 0 .../cava/config/shaders/northern_lights.frag | 0 .../cava/config/shaders/pass_through.vert | 0 modules/{cmd => cli}/media/cava/default.nix | 2 +- modules/{cmd => cli}/media/default.nix | 0 modules/{cmd => cli}/media/ffmpeg.nix | 2 +- .../media/go-musicfox/default.nix | 4 +- .../media/go-musicfox/go-musicfox.ini | 0 modules/{cmd => cli}/media/mpd/default.nix | 2 +- modules/{cmd => cli}/media/mpd/mpd.conf | 0 modules/{cmd => cli}/misc/default.nix | 2 +- modules/{cmd => cli}/misc/tmux.conf | 0 modules/{cmd => cli}/monitor/all.nix | 4 +- .../monitor/btop/config/btop.conf | 0 .../monitor/btop/config/themes/nord.theme | 0 modules/{cmd => cli}/monitor/btop/default.nix | 2 +- modules/{cmd => cli}/monitor/default.nix | 0 modules/{cmd => cli}/shell/all.nix | 4 +- modules/{cmd => cli}/shell/default.nix | 0 modules/{cmd => cli}/shell/zsh.nix | 2 +- modules/default.nix | 2 +- modules/desktop/wm/all.nix | 1 - modules/desktop/wm/default.nix | 1 - modules/desktop/wm/dwm.nix | 16 ---- modules/desktop/wm/niri/config.nix | 5 +- modules/nix.nix | 11 +-- modules/user.nix | 6 +- overlays/default.nix | 7 +- pkgs/translate-shell.nix | 2 +- secrets/imxyy-nix-rclone.conf | 23 +++++ variables.nix | 2 +- wslproxy.sh | 11 --- 51 files changed, 211 insertions(+), 332 deletions(-) delete mode 100644 config/hosts/imxyy-nix/rule_sets/steamcn.json delete mode 100755 docker_proxy.sh rename modules/{cmd => cli}/all.nix (91%) rename modules/{cmd => cli}/default.nix (100%) rename modules/{cmd => cli}/media/all.nix (90%) rename modules/{cmd => cli}/media/cava/config/config (100%) rename modules/{cmd => cli}/media/cava/config/config-applet (100%) rename modules/{cmd => cli}/media/cava/config/shaders/bar_spectrum.frag (100%) rename modules/{cmd => cli}/media/cava/config/shaders/normalized_bars.frag (100%) rename modules/{cmd => cli}/media/cava/config/shaders/northern_lights.frag (100%) rename modules/{cmd => cli}/media/cava/config/shaders/pass_through.vert (100%) rename modules/{cmd => cli}/media/cava/default.nix (96%) rename modules/{cmd => cli}/media/default.nix (100%) rename modules/{cmd => cli}/media/ffmpeg.nix (95%) rename modules/{cmd => cli}/media/go-musicfox/default.nix (89%) rename modules/{cmd => cli}/media/go-musicfox/go-musicfox.ini (100%) rename modules/{cmd => cli}/media/mpd/default.nix (97%) rename modules/{cmd => cli}/media/mpd/mpd.conf (100%) rename modules/{cmd => cli}/misc/default.nix (99%) rename modules/{cmd => cli}/misc/tmux.conf (100%) rename modules/{cmd => cli}/monitor/all.nix (86%) rename modules/{cmd => cli}/monitor/btop/config/btop.conf (100%) rename modules/{cmd => cli}/monitor/btop/config/themes/nord.theme (100%) rename modules/{cmd => cli}/monitor/btop/default.nix (96%) rename modules/{cmd => cli}/monitor/default.nix (100%) rename modules/{cmd => cli}/shell/all.nix (85%) rename modules/{cmd => cli}/shell/default.nix (100%) rename modules/{cmd => cli}/shell/zsh.nix (99%) delete mode 100644 modules/desktop/wm/dwm.nix create mode 100644 secrets/imxyy-nix-rclone.conf delete mode 100755 wslproxy.sh diff --git a/.sops.yaml b/.sops.yaml index 111afcf..9fdb2b5 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -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 diff --git a/config/base.nix b/config/base.nix index 9657036..e4ad190 100644 --- a/config/base.nix +++ b/config/base.nix @@ -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"; }; diff --git a/config/hosts/imxyy-nix-server/hardware.nix b/config/hosts/imxyy-nix-server/hardware.nix index a0e7abb..d870d43 100644 --- a/config/hosts/imxyy-nix-server/hardware.nix +++ b/config/hosts/imxyy-nix-server/hardware.nix @@ -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 diff --git a/config/hosts/imxyy-nix-server/home.nix b/config/hosts/imxyy-nix-server/home.nix index 5cfa02b..ea2b4bc 100644 --- a/config/hosts/imxyy-nix-server/home.nix +++ b/config/hosts/imxyy-nix-server/home.nix @@ -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; diff --git a/config/hosts/imxyy-nix-wsl/home.nix b/config/hosts/imxyy-nix-wsl/home.nix index db02c8a..dbcee5b 100644 --- a/config/hosts/imxyy-nix-wsl/home.nix +++ b/config/hosts/imxyy-nix-wsl/home.nix @@ -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; }; } diff --git a/config/hosts/imxyy-nix-wsl/nixos.nix b/config/hosts/imxyy-nix-wsl/nixos.nix index a6e4da3..c3ef8a6 100644 --- a/config/hosts/imxyy-nix-wsl/nixos.nix +++ b/config/hosts/imxyy-nix-wsl/nixos.nix @@ -4,7 +4,7 @@ nixos-wsl.nixosModules.wsl ]; wsl.enable = true; - wsl.defaultUser = "${username}"; + wsl.defaultUser = username; services.openssh = { enable = true; diff --git a/config/hosts/imxyy-nix/hardware.nix b/config/hosts/imxyy-nix/hardware.nix index 6848146..53f453a 100644 --- a/config/hosts/imxyy-nix/hardware.nix +++ b/config/hosts/imxyy-nix/hardware.nix @@ -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" = { diff --git a/config/hosts/imxyy-nix/home.nix b/config/hosts/imxyy-nix/home.nix index d281171..c226f48 100644 --- a/config/hosts/imxyy-nix/home.nix +++ b/config/hosts/imxyy-nix/home.nix @@ -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" - ]; }; }; } diff --git a/config/hosts/imxyy-nix/nixos.nix b/config/hosts/imxyy-nix/nixos.nix index 96d70a6..b92d5c6 100644 --- a/config/hosts/imxyy-nix/nixos.nix +++ b/config/hosts/imxyy-nix/nixos.nix @@ -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" + ]; + }; + }; } diff --git a/config/hosts/imxyy-nix/rule_sets/steamcn.json b/config/hosts/imxyy-nix/rule_sets/steamcn.json deleted file mode 100644 index f67f290..0000000 --- a/config/hosts/imxyy-nix/rule_sets/steamcn.json +++ /dev/null @@ -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 - } - ] -} diff --git a/docker_proxy.sh b/docker_proxy.sh deleted file mode 100755 index 6ac6dc2..0000000 --- a/docker_proxy.sh +++ /dev/null @@ -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 diff --git a/flake.lock b/flake.lock index af4467f..a6f0862 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index 935ba7d..5063aee 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; } ); diff --git a/modules/cmd/all.nix b/modules/cli/all.nix similarity index 91% rename from modules/cmd/all.nix rename to modules/cli/all.nix index 1c7be6c..ce07201 100644 --- a/modules/cmd/all.nix +++ b/modules/cli/all.nix @@ -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; diff --git a/modules/cmd/default.nix b/modules/cli/default.nix similarity index 100% rename from modules/cmd/default.nix rename to modules/cli/default.nix diff --git a/modules/cmd/media/all.nix b/modules/cli/media/all.nix similarity index 90% rename from modules/cmd/media/all.nix rename to modules/cli/media/all.nix index 003dde6..f496388 100644 --- a/modules/cmd/media/all.nix +++ b/modules/cli/media/all.nix @@ -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; diff --git a/modules/cmd/media/cava/config/config b/modules/cli/media/cava/config/config similarity index 100% rename from modules/cmd/media/cava/config/config rename to modules/cli/media/cava/config/config diff --git a/modules/cmd/media/cava/config/config-applet b/modules/cli/media/cava/config/config-applet similarity index 100% rename from modules/cmd/media/cava/config/config-applet rename to modules/cli/media/cava/config/config-applet diff --git a/modules/cmd/media/cava/config/shaders/bar_spectrum.frag b/modules/cli/media/cava/config/shaders/bar_spectrum.frag similarity index 100% rename from modules/cmd/media/cava/config/shaders/bar_spectrum.frag rename to modules/cli/media/cava/config/shaders/bar_spectrum.frag diff --git a/modules/cmd/media/cava/config/shaders/normalized_bars.frag b/modules/cli/media/cava/config/shaders/normalized_bars.frag similarity index 100% rename from modules/cmd/media/cava/config/shaders/normalized_bars.frag rename to modules/cli/media/cava/config/shaders/normalized_bars.frag diff --git a/modules/cmd/media/cava/config/shaders/northern_lights.frag b/modules/cli/media/cava/config/shaders/northern_lights.frag similarity index 100% rename from modules/cmd/media/cava/config/shaders/northern_lights.frag rename to modules/cli/media/cava/config/shaders/northern_lights.frag diff --git a/modules/cmd/media/cava/config/shaders/pass_through.vert b/modules/cli/media/cava/config/shaders/pass_through.vert similarity index 100% rename from modules/cmd/media/cava/config/shaders/pass_through.vert rename to modules/cli/media/cava/config/shaders/pass_through.vert diff --git a/modules/cmd/media/cava/default.nix b/modules/cli/media/cava/default.nix similarity index 96% rename from modules/cmd/media/cava/default.nix rename to modules/cli/media/cava/default.nix index 03b2e77..1b86332 100644 --- a/modules/cmd/media/cava/default.nix +++ b/modules/cli/media/cava/default.nix @@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig { packageName = "cava"; packagePath = [ "cava" ]; optionPath = [ - "cmd" + "cli" "media" "cava" ]; diff --git a/modules/cmd/media/default.nix b/modules/cli/media/default.nix similarity index 100% rename from modules/cmd/media/default.nix rename to modules/cli/media/default.nix diff --git a/modules/cmd/media/ffmpeg.nix b/modules/cli/media/ffmpeg.nix similarity index 95% rename from modules/cmd/media/ffmpeg.nix rename to modules/cli/media/ffmpeg.nix index f496661..da8ae0d 100644 --- a/modules/cmd/media/ffmpeg.nix +++ b/modules/cli/media/ffmpeg.nix @@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig { packageName = "ffmpeg"; packagePath = [ "ffmpeg" ]; optionPath = [ - "cmd" + "cli" "media" "ffmpeg" ]; diff --git a/modules/cmd/media/go-musicfox/default.nix b/modules/cli/media/go-musicfox/default.nix similarity index 89% rename from modules/cmd/media/go-musicfox/default.nix rename to modules/cli/media/go-musicfox/default.nix index 81dc2dd..999a2c0 100644 --- a/modules/cmd/media/go-musicfox/default.nix +++ b/modules/cli/media/go-musicfox/default.nix @@ -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; }; }; } diff --git a/modules/cmd/media/go-musicfox/go-musicfox.ini b/modules/cli/media/go-musicfox/go-musicfox.ini similarity index 100% rename from modules/cmd/media/go-musicfox/go-musicfox.ini rename to modules/cli/media/go-musicfox/go-musicfox.ini diff --git a/modules/cmd/media/mpd/default.nix b/modules/cli/media/mpd/default.nix similarity index 97% rename from modules/cmd/media/mpd/default.nix rename to modules/cli/media/mpd/default.nix index e3337a4..fb54031 100644 --- a/modules/cmd/media/mpd/default.nix +++ b/modules/cli/media/mpd/default.nix @@ -8,7 +8,7 @@ lib.my.makeSwitch { inherit config; optionName = "mpd"; optionPath = [ - "cmd" + "cli" "media" "mpd" ]; diff --git a/modules/cmd/media/mpd/mpd.conf b/modules/cli/media/mpd/mpd.conf similarity index 100% rename from modules/cmd/media/mpd/mpd.conf rename to modules/cli/media/mpd/mpd.conf diff --git a/modules/cmd/misc/default.nix b/modules/cli/misc/default.nix similarity index 99% rename from modules/cmd/misc/default.nix rename to modules/cli/misc/default.nix index 1c317ef..78af694 100644 --- a/modules/cmd/misc/default.nix +++ b/modules/cli/misc/default.nix @@ -11,7 +11,7 @@ lib.my.makeSwitch { default = true; optionName = "misc command line tools"; optionPath = [ - "cmd" + "cli" "misc" ]; config' = { diff --git a/modules/cmd/misc/tmux.conf b/modules/cli/misc/tmux.conf similarity index 100% rename from modules/cmd/misc/tmux.conf rename to modules/cli/misc/tmux.conf diff --git a/modules/cmd/monitor/all.nix b/modules/cli/monitor/all.nix similarity index 86% rename from modules/cmd/monitor/all.nix rename to modules/cli/monitor/all.nix index 4c94258..1b3eccd 100644 --- a/modules/cmd/monitor/all.nix +++ b/modules/cli/monitor/all.nix @@ -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; }; }; diff --git a/modules/cmd/monitor/btop/config/btop.conf b/modules/cli/monitor/btop/config/btop.conf similarity index 100% rename from modules/cmd/monitor/btop/config/btop.conf rename to modules/cli/monitor/btop/config/btop.conf diff --git a/modules/cmd/monitor/btop/config/themes/nord.theme b/modules/cli/monitor/btop/config/themes/nord.theme similarity index 100% rename from modules/cmd/monitor/btop/config/themes/nord.theme rename to modules/cli/monitor/btop/config/themes/nord.theme diff --git a/modules/cmd/monitor/btop/default.nix b/modules/cli/monitor/btop/default.nix similarity index 96% rename from modules/cmd/monitor/btop/default.nix rename to modules/cli/monitor/btop/default.nix index fdd3b48..a1bec20 100644 --- a/modules/cmd/monitor/btop/default.nix +++ b/modules/cli/monitor/btop/default.nix @@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig { packageName = "btop"; packagePath = [ "btop" ]; optionPath = [ - "cmd" + "cli" "monitor" "btop" ]; diff --git a/modules/cmd/monitor/default.nix b/modules/cli/monitor/default.nix similarity index 100% rename from modules/cmd/monitor/default.nix rename to modules/cli/monitor/default.nix diff --git a/modules/cmd/shell/all.nix b/modules/cli/shell/all.nix similarity index 85% rename from modules/cmd/shell/all.nix rename to modules/cli/shell/all.nix index 4a38baa..e79582c 100644 --- a/modules/cmd/shell/all.nix +++ b/modules/cli/shell/all.nix @@ -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; }; }; diff --git a/modules/cmd/shell/default.nix b/modules/cli/shell/default.nix similarity index 100% rename from modules/cmd/shell/default.nix rename to modules/cli/shell/default.nix diff --git a/modules/cmd/shell/zsh.nix b/modules/cli/shell/zsh.nix similarity index 99% rename from modules/cmd/shell/zsh.nix rename to modules/cli/shell/zsh.nix index 54a71bc..c6d2961 100644 --- a/modules/cmd/shell/zsh.nix +++ b/modules/cli/shell/zsh.nix @@ -9,7 +9,7 @@ lib.my.makeSwitch { default = true; optionName = "default zsh settings"; optionPath = [ - "cmd" + "cli" "shell" "zsh" ]; diff --git a/modules/default.nix b/modules/default.nix index b89ec06..23f9e77 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,7 +5,7 @@ }: { imports = [ - ./cmd + ./cli ./coding ./virt ./desktop diff --git a/modules/desktop/wm/all.nix b/modules/desktop/wm/all.nix index c88156c..d94c778 100644 --- a/modules/desktop/wm/all.nix +++ b/modules/desktop/wm/all.nix @@ -14,7 +14,6 @@ lib.my.makeSwitch { config' = { my.desktop.wm = { cage.enable = true; - dwm.enable = true; niri.enable = true; }; }; diff --git a/modules/desktop/wm/default.nix b/modules/desktop/wm/default.nix index 4527806..019f9a2 100644 --- a/modules/desktop/wm/default.nix +++ b/modules/desktop/wm/default.nix @@ -3,7 +3,6 @@ imports = [ ./all.nix ./cage.nix - ./dwm.nix ./niri ]; } diff --git a/modules/desktop/wm/dwm.nix b/modules/desktop/wm/dwm.nix deleted file mode 100644 index cccc4b4..0000000 --- a/modules/desktop/wm/dwm.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -lib.my.makeHomePackageConfig { - inherit config pkgs; - packageName = "dwm"; - packagePath = [ "dwm" ]; - optionPath = [ - "desktop" - "wm" - "dwm" - ]; -} diff --git a/modules/desktop/wm/niri/config.nix b/modules/desktop/wm/niri/config.nix index 092fad5..0b3a5eb 100644 --- a/modules/desktop/wm/niri/config.nix +++ b/modules/desktop/wm/niri/config.nix @@ -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 = { diff --git a/modules/nix.nix b/modules/nix.nix index 30590b1..05c8994 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -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; }; } diff --git a/modules/user.nix b/modules/user.nix index d159b37..fe39158 100644 --- a/modules/user.nix +++ b/modules/user.nix @@ -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 = { diff --git a/overlays/default.nix b/overlays/default.nix index 0ee9112..1768e9e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -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; diff --git a/pkgs/translate-shell.nix b/pkgs/translate-shell.nix index e74615e..679a1f9 100644 --- a/pkgs/translate-shell.nix +++ b/pkgs/translate-shell.nix @@ -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="; }; diff --git a/secrets/imxyy-nix-rclone.conf b/secrets/imxyy-nix-rclone.conf new file mode 100644 index 0000000..97e705e --- /dev/null +++ b/secrets/imxyy-nix-rclone.conf @@ -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" + } +} diff --git a/variables.nix b/variables.nix index 19a737b..8db92d9 100644 --- a/variables.nix +++ b/variables.nix @@ -23,7 +23,7 @@ rec { in [ { - hostname = "${hostprefix}"; + hostname = hostprefix; system = x86_64.linux; } { diff --git a/wslproxy.sh b/wslproxy.sh deleted file mode 100755 index a57f7fe..0000000 --- a/wslproxy.sh +++ /dev/null @@ -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