From 1fcf0ebc57bb15aa923903386cb79061ec437cfd Mon Sep 17 00:00:00 2001 From: MrSnowy Date: Mon, 15 Sep 2025 11:52:33 +0000 Subject: [PATCH] use deploy-rs --- nixos/home-manager/snowy.nix | 3 +-- nixos/system/configuration.nix | 2 ++ server/flake.lock | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- server/flake.nix | 15 +++++++++++++++ server/home-manager/apps/fish.nix | 17 ++++++++++++----- 5 file(s) changed, 117 insertion(s)(+), 8 deletion(s)(-) diff --git a/nixos/home-manager/snowy.nix b/nixos/home-manager/snowy.nix --- a/nixos/home-manager/snowy.nix +++ b/nixos/home-manager/snowy.nix @@ -65,11 +65,10 @@ # wine64 pkgs-extra-unstable.hyprlandPlugins.hyprsplit ]; - systemd.user.sessionVariables = { # Define some locations of some files, this seemed like the least wack way to do things. POLKIT_GNOME = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - LIB_HYPRSPLIT = "${pkgs-extra-unstable.hyprlandPlugins.hyprsplit}/lib/libhyprsplit.so" + LIB_HYPRSPLIT = "${pkgs-extra-unstable.hyprlandPlugins.hyprsplit}/lib/libhyprsplit.so"; }; programs = { diff --git a/nixos/system/configuration.nix b/nixos/system/configuration.nix --- a/nixos/system/configuration.nix +++ b/nixos/system/configuration.nix @@ -590,6 +590,8 @@ # QUICKSHELL quickshell qt6.full + distrobox + (discord.override { withOpenASAR = true; withVencord = true; diff --git a/server/flake.lock b/server/flake.lock --- a/server/flake.lock +++ b/server/flake.lock @@ -1,5 +1,41 @@ { "nodes": { + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1756719547, + "narHash": "sha256-N9gBKUmjwRKPxAafXEk1EGadfk2qDZPBQp4vXWPHINQ=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "125ae9e3ecf62fb2c0fd4f2d894eb971f1ecaed2", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -23,6 +59,22 @@ } }, "nixpkgs": { "locked": { + "lastModified": 1743014863, + "narHash": "sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { "lastModified": 1754292888, "narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=", "owner": "NixOS", @@ -39,8 +91,42 @@ } }, "root": { "inputs": { + "deploy-rs": "deploy-rs", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "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" } } }, diff --git a/server/flake.nix b/server/flake.nix --- a/server/flake.nix +++ b/server/flake.nix @@ -8,13 +8,17 @@ url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + deploy-rs.url = "github:serokell/deploy-rs"; + # zenium.url = "git+https://git.killuaa.dev/Rouffy/Zenium"; }; outputs = { + self, nixpkgs, home-manager, + deploy-rs, # zenium, ... }@inputs: @@ -46,6 +50,17 @@ }; } ]; + }; + + # deploy-rs config + deploy.nodes.snow-den = { + hostname = "server"; # can be IP or hostname in SSH config + profiles.system = { + sshUser = "snow"; # non-root user with access + user = "root"; + interacticeSudo = true; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.snow-den; + }; }; }; } diff --git a/server/home-manager/apps/fish.nix b/server/home-manager/apps/fish.nix --- a/server/home-manager/apps/fish.nix +++ b/server/home-manager/apps/fish.nix @@ -15,8 +15,14 @@ # ''; # }; # }; shellInit = '' - set -xg fish_color_command blue - echo hello + if status is-interactive + set -xg fish_color_command blue + echo "Welcome to $(whoami)@$(hostname)!" + echo "---" + echo "Current generations:" + listgens + echo "" + end ''; shellAliases = { fetch = "clear && fastfetch"; @@ -32,9 +38,10 @@ docres = "docker compose down && docker compose up -d"; docvol = "cd ~/.local/share/docker/volumes"; logboot = "journalctl --boot=-1 --reverse"; - reslave = "nh os switch ~/Nixos -u && nh clean all"; - rebuild = "nh os switch ~/Nixos"; - rebuildc = "nh os switch ~/Nixos && nh clean all"; + # reslave = "nh os switch ~/Nixos -u && nh clean all"; + # rebuild = "nh os switch ~/Nixos"; + # rebuildc = "nh os switch ~/Nixos && nh clean all"; + listgens = "sudo nix-env -p /nix/var/nix/profiles/system --list-generations"; }; }; } -- tangled.sh