From cea3b045ca04434eb480353b84c6405b54c4c0fc Mon Sep 17 00:00:00 2001 From: pagedmov Date: Sun, 17 Nov 2024 23:30:55 -0500 Subject: [PATCH] more configuration for live environment --- flake.nix | 14 +++-- hosts/live-env/config.nix | 34 ++++++++++- hosts/live-env/disko-ext4-singledisk.nix | 56 ----------------- hosts/live-env/disko.nix | 76 ++++++++++++++++++++++++ hosts/live-env/home.nix | 49 ++++++++++++++- 5 files changed, 166 insertions(+), 63 deletions(-) delete mode 100755 hosts/live-env/disko-ext4-singledisk.nix create mode 100644 hosts/live-env/disko.nix diff --git a/flake.nix b/flake.nix index 481fe63..4107db7 100755 --- a/flake.nix +++ b/flake.nix @@ -103,6 +103,9 @@ pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; + overlays = [ + (import ./overlay/overlay.nix { inherit host; root = self; }) + ]; }; extraSpecialArgs = { inherit host self username inputs; @@ -112,12 +115,16 @@ (import ./hosts/live-env/home.nix { username = "impermanence"; }) nixvim.homeManagerModules.nixvim stylix.homeManagerModules.stylix + nur.nixosModules.nur ]; }; neonPersistenceHome = let host = "neonPersistence"; in home-manager.lib.homeManagerConfiguration { # Live Environment pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; + overlays = [ + (import ./overlay/overlay.nix { inherit host; root = self; }) + ]; }; extraSpecialArgs = { inherit host self username inputs; @@ -127,6 +134,7 @@ (import ./hosts/live-env/home.nix { username = "persistence"; }) nixvim.homeManagerModules.nixvim stylix.homeManagerModules.stylix + nur.nixosModules.nur ]; }; }; @@ -141,7 +149,6 @@ pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; - overlays = []; }; modules = [ ./hosts/desktop/config.nix @@ -160,7 +167,6 @@ pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; - overlays = []; }; modules = [ ./hosts/laptop/config.nix @@ -179,7 +185,6 @@ pkgs = import nixpkgs { inherit system; config = nixpkgsConfig; - overlays = []; }; modules = [ ./hosts/server/config.nix @@ -201,10 +206,11 @@ overlays = []; }; modules = [ - ./hosts/live-env + ./hosts/live-env/config.nix ./modules/sys nixvim.nixosModules.nixvim stylix.nixosModules.stylix + nur.nixosModules.nur ]; }; }; diff --git a/hosts/live-env/config.nix b/hosts/live-env/config.nix index 75b0bf1..d0002a5 100755 --- a/hosts/live-env/config.nix +++ b/hosts/live-env/config.nix @@ -22,12 +22,44 @@ in bootLoader.enable = true; }; softwareCfg = { - sysPkgs.enable = true; sysProgs.enable = true; sysServices.enable = true; }; }; + environment.systemPackages = with pkgs;[ + alsa-lib + xwayland + wayland + alsa-utils + bc + cliphist + git + hyprpaper + hyprpicker + inetutils + kitty + lsof + neofetch + nh + nix-output-monitor + nix-prefetch-scripts + nixos-option + nix-search-cli + nix-template + nixfmt + nvd + pamixer + pavucontrol + playerctl + usbutils + vim + jq + wl-clipboard + libnotify + file + ]; + users = { groups.persist = { }; users = { diff --git a/hosts/live-env/disko-ext4-singledisk.nix b/hosts/live-env/disko-ext4-singledisk.nix deleted file mode 100755 index a84914e..0000000 --- a/hosts/live-env/disko-ext4-singledisk.nix +++ /dev/null @@ -1,56 +0,0 @@ -# USAGE in your configuration.nix. -# Update devices to match your hardware. -{ device ? throw "Set this to your disk device, e.g. /dev/sda", root_size -, nix_size, ... }: { - disko.devices = { - disk = { - main = { - inherit device; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - ESP = { - size = "1G"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - nix = { - size = "${nix_size}"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/nix"; - }; - }; - root = { - size = "${root_size}"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - home = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/home"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/hosts/live-env/disko.nix b/hosts/live-env/disko.nix new file mode 100644 index 0000000..0f9c33c --- /dev/null +++ b/hosts/live-env/disko.nix @@ -0,0 +1,76 @@ +{ + device ? throw "Set this to your disk device, e.g. /dev/sda", + ... +}: { + disko.devices = { + disk.main = { + inherit device; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { + name = "ESP"; + size = "750M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + swap = { + size = "4G"; + content = { + type = "swap"; + resumeDevice = true; + }; + }; + root = { + name = "root"; + size = "100%"; + content = { + type = "lvm_pv"; + vg = "root_vg"; + }; + }; + }; + }; + }; + lvm_vg = { + root_vg = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%FREE"; + content = { + type = "btrfs"; + extraArgs = ["-f"]; + + subvolumes = { + "/root" = { + mountpoint = "/"; + }; + + "/home/persistence" = { + mountOptions = ["subvol=persist" "noatime"]; + mountpoint = "/home/persistence"; + }; + + "/nix" = { + mountOptions = ["subvol=nix" "noatime"]; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/live-env/home.nix b/hosts/live-env/home.nix index d175af7..4e73818 100644 --- a/hosts/live-env/home.nix +++ b/hosts/live-env/home.nix @@ -1,5 +1,30 @@ -{ username, ... }: +{ pkgs, username, ... }: +let + scripts = with pkgs; [ + myScripts.icanhazip + myScripts.invoke + myScripts.runbg + myScripts.splash + myScripts.toolbelt + myScripts.viconf + myScripts.vipkg + myScripts.fetchfromgh + myScripts.garbage-collect + myScripts.nsp + myScripts.rebuild + myScripts.chpaper + myScripts.chscheme + myScripts.keyring + myScripts.mkscreenshots + myScripts.moveonscreen + myScripts.s_check + myScripts.switchmon + myScripts.git-compose + myScripts.playshellsound + myScripts.color-commit + ]; +in { home.username = "${username}"; home.homeDirectory = "/home/${username}"; @@ -7,6 +32,26 @@ programs.home-manager.enable = true; + home.packages = with pkgs; [ + nemo + feh + gtk3 + sqlite + gimp + imagemagick + lolcat + vesktop + zsh + zsh-syntax-highlighting + zsh-history-substring-search + zsh-autosuggestions + libreoffice + gtrash + ripgrep + toilet-extrafonts + chafa + ] ++ scripts; + movOpts = { homeFiles.enable = true; envConfig = { @@ -15,7 +60,7 @@ monitorNames = [ "eDP-1" ]; workspaceLayout = "singlemonitor"; }; - userPkgs.enable = true; + userPkgs.enable = false; stylixHomeConfig.enable = true; gtkConfig.enable = true; starshipConfig.enable = true;