From 33a93dfea6365069b52ab518ac4fd1d4c74ca0ff Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Thu, 28 Aug 2025 15:26:40 -0400 Subject: [PATCH] Ok, resigned that we need home-manager and system-manager seperate. Working niri --- home-manager/flake.lock | 156 ++++++++++++++++++++++++++++++++ home-manager/flake.nix | 39 ++++++++ home-manager/home.nix | 10 +- system-manager/flake.lock | 123 +++++++++++++++++++++++++ system-manager/flake.nix | 34 +++++++ work_activate_home_manager.sh | 3 + work_activate_system_manager.sh | 2 + 7 files changed, 364 insertions(+), 3 deletions(-) create mode 100644 home-manager/flake.lock create mode 100644 home-manager/flake.nix create mode 100644 system-manager/flake.lock create mode 100644 system-manager/flake.nix create mode 100755 work_activate_home_manager.sh create mode 100755 work_activate_system_manager.sh diff --git a/home-manager/flake.lock b/home-manager/flake.lock new file mode 100644 index 0000000..bcb0794 --- /dev/null +++ b/home-manager/flake.lock @@ -0,0 +1,156 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756261190, + "narHash": "sha256-eiy0klFK5EVJLNilutR7grsZN/7Itj9DyD75eyOf83k=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "77f348da3176dc68b20a73dab94852a417daf361", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1756284022, + "narHash": "sha256-5q5rKE9Cbt1qDXtqgRr9FSeJrhS6apGatP3s9Oyejh8=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "a98afc5eb87093eec2f70c2e53e5faf919875025", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1748151941, + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.05.1", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1756275478, + "narHash": "sha256-BvPxbh+37rb5SHS5zFF6lis63B8BTuKDGRqMjbb9qBU=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "e038b8770a17b67cbf9c9d007a1f3a9ac0b53c60", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1756125398, + "narHash": "sha256-XexyKZpf46cMiO5Vbj+dWSAXOnr285GHsMch8FBoHbc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3b9f00d7a7bf68acd4c4abb9d43695afb04e03a5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1756217674, + "narHash": "sha256-TH1SfSP523QI7kcPiNtMAEuwZR3Jdz0MCDXPs7TS8uo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4e7667a90c167f7a81d906e5a75cba4ad8bee620", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "niri": "niri", + "nixpkgs": "nixpkgs" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.7", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1756260173, + "narHash": "sha256-wcf04fl5ncbOqAK7OCWIgILERIbMfL/eeM3UThqgErI=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "af33f7eb124b51ff6d9cdf9b428643e2246c8cbb", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/flake.nix b/home-manager/flake.nix new file mode 100644 index 0000000..a9cf70f --- /dev/null +++ b/home-manager/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Home Manager configuration of nbraswell6"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { nixpkgs, niri, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + homeConfigurations."nbraswell6" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ((import ./home.nix) { username = "nbraswell6"; homeDirectory = "/home/nbraswell6";}) + #niri.nixosModules.niri + niri.homeModules.niri + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix index 8bf939b..b732950 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }:{ +{ username, homeDirectory }: ({ config, pkgs, lib, ... }:{ # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards @@ -8,11 +8,14 @@ # the Home Manager release notes for a list of state version # changes in each release. home.stateVersion = "22.11"; + home.username = username; + home.homeDirectory = homeDirectory; fonts.fontconfig.enable = true; home.packages = with pkgs; [ fira-code jetbrains-mono iosevka monoid recursive inter xwayland-satellite swww + niri ]; systemd.user.services.mpris-proxy = { @@ -99,7 +102,7 @@ }; spawn-at-startup = [ { command = [ "swww-daemon" ]; } - { command = [ "swww" "img" "${config.stylix.image}" ]; } + #{ command = [ "swww" "img" "${config.stylix.image}" ]; } { command = [ "waybar" ]; } { command = [ "xwayland-satellite" ]; } ]; @@ -393,6 +396,7 @@ }; profileExtra = '' if [ -e /home/nathan/.nix-profile/etc/profile.d/nix.sh ]; then . /home/nathan/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer + export PATH="/run/system-manager/sw/bin/:/home/nbraswell6/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH" ''; shellAliases = { ng ="nmcli c up NETGEAR97"; @@ -537,4 +541,4 @@ rainbow-delimiters dracula-theme ]; }; - } + }) diff --git a/system-manager/flake.lock b/system-manager/flake.lock new file mode 100644 index 0000000..d8728dc --- /dev/null +++ b/system-manager/flake.lock @@ -0,0 +1,123 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756261190, + "narHash": "sha256-eiy0klFK5EVJLNilutR7grsZN/7Itj9DyD75eyOf83k=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "77f348da3176dc68b20a73dab94852a417daf361", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nix-system-graphics": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737457219, + "narHash": "sha256-nX9dxoATDCSQgWw/iv6BngXDJEyHVYYEvHEVQ7Ig3fI=", + "owner": "soupglasses", + "repo": "nix-system-graphics", + "rev": "9c875e0c56cf2eb272b9102a4f3e24e4e31629fd", + "type": "github" + }, + "original": { + "owner": "soupglasses", + "repo": "nix-system-graphics", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1756125398, + "narHash": "sha256-XexyKZpf46cMiO5Vbj+dWSAXOnr285GHsMch8FBoHbc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3b9f00d7a7bf68acd4c4abb9d43695afb04e03a5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "home-manager": "home-manager", + "nix-system-graphics": "nix-system-graphics", + "nixpkgs": "nixpkgs", + "system-manager": "system-manager" + } + }, + "system-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756281415, + "narHash": "sha256-CjpoVwpJJ+DOZilPrDpZ5S3V+B1Y0calaHxTp2xMvGs=", + "owner": "numtide", + "repo": "system-manager", + "rev": "e271eedac9a24678ca6cfc61677837422bf474e0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "system-manager", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/system-manager/flake.nix b/system-manager/flake.nix new file mode 100644 index 0000000..a12a312 --- /dev/null +++ b/system-manager/flake.nix @@ -0,0 +1,34 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + system-manager = { + url = "github:numtide/system-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-system-graphics = { + url = "github:soupglasses/nix-system-graphics"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, flake-utils, nixpkgs, system-manager, nix-system-graphics, home-manager }: { + systemConfigs.default = system-manager.lib.makeSystemConfig { + modules = [ + nix-system-graphics.systemModules.default + ({ + config = { + nixpkgs.hostPlatform = "x86_64-linux"; + system-manager.allowAnyDistro = true; + system-graphics.enable = true; + }; + }) + ]; + }; + }; +} diff --git a/work_activate_home_manager.sh b/work_activate_home_manager.sh new file mode 100755 index 0000000..d999b3f --- /dev/null +++ b/work_activate_home_manager.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +nix run home-manager/master -- switch --flake ~/nix_config/home-manager +#home-manager switch --flake ~/nix_config/home-manager diff --git a/work_activate_system_manager.sh b/work_activate_system_manager.sh new file mode 100755 index 0000000..25aba0b --- /dev/null +++ b/work_activate_system_manager.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +nix run --extra-experimental-features 'nix-command flakes' 'github:numtide/system-manager' -- switch --flake /home/nbraswell6/nix_config/system-manager