From 0bfdb5858ce1b2115e465cddb595776567df3cfc Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 27 Feb 2026 00:51:33 +0000 Subject: [PATCH] Super simplify --- flake.lock | 135 +++++++++++++-- flake.nix | 341 +++++++++++++++++++++++++++++++------ hardware-configuration.nix | 72 ++++++-- home/default.nix | 21 --- home/user/default.nix | 19 --- home/user/impermanence.nix | 12 -- home/user/packages.nix | 65 ------- home/user/programs.nix | 75 -------- home/user/scripts.nix | 43 ----- modules/boot.nix | 34 ---- modules/default.nix | 11 -- modules/impermanenc.nix | 14 -- modules/networking.nix | 8 - modules/packages.nix | 37 ---- modules/programs.nix | 9 - modules/users.nix | 13 -- 16 files changed, 464 insertions(+), 445 deletions(-) delete mode 100644 home/default.nix delete mode 100644 home/user/default.nix delete mode 100644 home/user/impermanence.nix delete mode 100644 home/user/packages.nix delete mode 100644 home/user/programs.nix delete mode 100644 home/user/scripts.nix delete mode 100644 modules/boot.nix delete mode 100644 modules/default.nix delete mode 100644 modules/impermanenc.nix delete mode 100644 modules/networking.nix delete mode 100644 modules/packages.nix delete mode 100644 modules/programs.nix delete mode 100644 modules/users.nix diff --git a/flake.lock b/flake.lock index bb50ac0..4bf099a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,9 +2,7 @@ "nodes": { "disko": { "inputs": { - "nixpkgs": [ - "nixpkgs-unstable" - ] + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1768920986, @@ -21,29 +19,142 @@ "type": "github" } }, + "firefox-addons": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1772078860, + "narHash": "sha256-Pojf7QHic9RmZFIoWYx5LoHy1UytoOHuGnLH3U5Nipo=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "ae41eb07a37d1d5cd7b5714df0fbcb315c492e4d", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1772020340, + "narHash": "sha256-aqBl3GNpCadMoJ/hVkWTijM1Aeilc278MjM+LA3jK6g=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "36e38ca0d9afe4c55405fdf22179a5212243eecc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "impermanence", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772060133, + "narHash": "sha256-VuyRptb8v1lVGMlLp4/1vRX3Efwec0CN0S6mKmDPzLg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ce9b6e52500a0ea0ec48f0bbf6d7a3e431d9dfa4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "impermanence": { + "inputs": { + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1769548169, + "narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "7b1d382faf603b6d264f58627330f9faa5cba149", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1772082373, + "narHash": "sha256-wySf8a6hvuqgFdwvvzPPTARBCMLDz7WFAufGkllD1M4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "26eaeac4e409d7b5a6bf6f90a2a2dc223c78d915", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1771903837, "narHash": "sha256-sdaqdnsQCv3iifzxwB22tUwN/fSHoN7j2myFW5EIkGk=", - "owner": "nixos", + "owner": "NixOS", "repo": "nixpkgs", "rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-25.11", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs_3": { "locked": { - "lastModified": 1714076141, - "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", "type": "github" }, "original": { @@ -56,8 +167,10 @@ "root": { "inputs": { "disko": "disko", - "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable" + "firefox-addons": "firefox-addons", + "home-manager": "home-manager", + "impermanence": "impermanence", + "nixpkgs": "nixpkgs_4" } } }, diff --git a/flake.nix b/flake.nix index 65e6702..ef32d11 100644 --- a/flake.nix +++ b/flake.nix @@ -2,67 +2,49 @@ description = "Stationette nix config"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - #impermanence = { - # url = "github:nix-community/impermanence"; - # inputs.nixpkgs.follows = ""; - # inputs.home-manager.follows = ""; - #}; - #home-manager.url = "github:nix-community/home-manager/release-25.11"; - #home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; disko.url = "github:nix-community/disko/latest"; - disko.inputs.nixpkgs.follows = "nixpkgs-unstable"; - #firefox-addons = { - # url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; - # inputs.nixpkgs.follows = "nixpkgs"; - #}; + impermanence.url = "github:nix-community/impermanence"; + home-manager.url = "github:nix-community/home-manager/release-25.11"; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, - nixpkgs-unstable, - #home-manager, - #impermanence, + impermanence, disko, + home-manager, ... } @ inputs: let lib = nixpkgs.lib; - # Supported systems for your flake packages, shell, etc. - # "aarch64-linux" - # "i686-linux" - # "x86_64-linux" - # "aarch64-darwin" - # "x86_64-darwin" system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; - #pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; in { - # NixOS configuration entrypoint - # Available through 'nixos-rebuild --flake .#stationette' nixosConfigurations = { stationette = nixpkgs.lib.nixosSystem { modules = [ ./hardware-configuration.nix - { - imports = [ - { - #imports = [ - # ./boot.nix - # ./networking.nix - # ./packages.nix - # ./programs.nix - # ./users.nix - #]; - } - ]; - - system.stateVersion = "25.11"; - } disko.nixosModules.disko - # nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- --flake=./#stationette --disk=stationette /dev/sda + impermanence.nixosModules.impermanence + home-manager.nixosModules.home-manager { + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/var/log" + "/var/lib/bluetooth" + "/var/lib/networkmanager" + "/etc/ssh" + ]; + files = [ + "/etc/machine-id" + ]; + }; + # nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko/latest#disko-install -- --flake=./#stationette --disk=stationette /dev/sda disko.devices = { disk = { stationette = { @@ -110,20 +92,268 @@ }; }; }; + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + networking = { + hostName = "stationette"; + networkmanager.enable = true; + }; + users.users.chris = { + uid = 1000; + isNormalUser = true; + shell = pkgs.zsh; + extraGroups = [ + "chris" + "wheel" + "networkmanager" + ]; + }; + programs.zsh = { + enable = true; + }; + + system.stateVersion = "25.11"; + environment.systemPackages = with pkgs; [ + #bat + #highlight + #btop + #eza + #fzf + #git + #gnumake + #neofetch + #neovim + #ripgrep + #tldr + #unzip + #openssl + #wget + #zip + #zoxide + #jq + #lazygit + #lazysql + #less + #mlocate + #tree + #tmux + #tmuxinator + #wget + #zenity + #gum + #yazi + #rsync + #p7zip + #impala + ]; + home-manager = { + users.chris = { pkgs, lib, ... }: { + home = { + username = "chris"; + homeDirectory = "/home/chris"; + stateVersion = "25.11"; + persistence."/persist" = { + directories = [ + "Downloads" + "Tower" + ".config/dotfiles" + ".local/share/direnv" + ".ssh" + ]; + }; + activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' + if [[ -v DRY_RUN ]]; then + echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" + fi + + DOTFILES_DIR="$HOME/.config/dotfiles" + + if [ -d "$DOTFILES_DIR/.git" ]; then + # Restore tracked files from the local metadata + ${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" checkout -f + ${pkgs.git}/bin/git submodule update --init --recursive + else + echo "Dotfiles not found. Running bootstrap script..." + + # Setup a temporary workspace + TEMP_DIR=$(mktemp -d) + + # Clone the repo (using the public URL for the initial pull) + ${pkgs.git}/bin/git clone -b main https://labs.scarif.space/chris/dotfiles.git "$TEMP_DIR" + + # Copy files to HOME + ${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME" + + # Initialize the separate git directory + ${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR" + cd "$HOME" + ${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME" + + # Update submodules + ${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git + ${pkgs.git}/bin/git submodule update --init + + # Set URLs back to SSH + ${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git + ${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git + + # Clean up + ${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR" + ${pkgs.coreutils}/bin/rm -f "$HOME/.git" + + echo "Dotfiles bootstrapped successfully." + fi + ''; + packages = with pkgs; [ + # jetbrains.rider + # android-studio + # beekeeper-studio + # brave + # discord + # spotify + # go + # lua + # nodePackages.pnpm + # (python3.withPackages (python-pkgs: [ python-pkgs.pip python-pkgs.requests ])) + # rustup + # zig + # obsidian + # thunderbird + # libreoffice-qt + # pkgs-unstable.nerd-fonts.fira-code + # hunspell + # blueberry + # steam + # steam-run + # viewnior + # pkgs-unstable.hyprshot + # catppuccin-cursors.macchiatoBlue + # catppuccin-gtk + # papirus-folders + # pkgs-unstable.php84Packages.composer + # pkgs-unstable.php84Packages.xdebug + # pkgs-unstable.php84Extensions.sqlite3 + # pkgs-unstable.php84Extensions.redis + # pkgs-unstable.php84Extensions.sodium + # pkgs-unstable.php84Extensions.pgsql + # pkgs-unstable.php84Extensions.iconv + # pkgs-unstable.php84Extensions.gd + # pkgs-unstable.php84Extensions.zip + # php + # antigravity + # gimp + # kdePackages.dolphin + # enpass + # enpass-cli + # expressvpn + # jellyfin-ffmpeg + # inkscape + # krita + # libreoffice-fresh + # nextcloud-client + # nodejs_24 + # signal-desktop + # sxiv + # tenacity + # unzip + # zathura + # ghostty + # wally-cli + # kdePackages.wacomtablet + # kdePackages.print-manager + # mpv + # vlc + # telegram-desktop + ]; + }; + programs = let + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; + in { + # firefox = { + # enable = true; + # package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + # extraPolicies = { + # DisableTelemetry = true; + # DisableFirefoxStudies = true; + # EnableTrackingProtection = { + # Value= true; + # Locked = true; + # Cryptomining = true; + # Fingerprinting = true; + # }; + # DisablePocket = true; + # DisableFirefoxAccounts = true; + # DisableAccounts = true; + # DisableFirefoxScreenshots = true; + # OverrideFirstRunPage = ""; + # OverridePostUpdatePage = ""; + # DontCheckDefaultBrowser = true; + # DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" + # DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + # SearchBar = "unified"; # alternative: "separate" + + # /* ---- EXTENSIONS ---- */ + # ExtensionSettings = { + # "*".installation_mode = "allowed"; # blocks all addons except the ones specified below + # # Enpass + # "firefox-enpass@enpass.io" = { + # install_url = "https://dl.enpass.io/stable/extensions/firefox/versions/v6.11.10.2/enpass_password_manager-6.11.10.2.xpi"; + # installation_mode = "force_installed"; + # }; + # }; + + # /* ---- PREFERENCES ---- */ + # # Set preferences shared by all profiles. + # Preferences = { + # "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + # "extensions.pocket.enabled" = lock-false; + # "extensions.screenshots.disabled" = lock-true; + # "browser.topsites.contile.enabled" = lock-false; + # "browser.formfill.enable" = lock-false; + # "browser.search.suggest.enabled" = lock-false; + # "browser.search.suggest.enabled.private" = lock-false; + # "browser.urlbar.suggest.searches" = lock-false; + # "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + # "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + # "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + # "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + # "browser.newtabpage.activity-stream.showSponsored" = lock-false; + # "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + # "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + # }; + # }; + # }; + # }; + }; + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = (_: true); + + permittedInsecurePackages = [ + "electron-25.9.0" # Obsidian + "beekeeper-studio-5.3.4" + ]; + }; + }; + }; + extraSpecialArgs = { + inherit inputs; + }; + }; } - #home-manager.nixosModules.home-manager - #{ - # imports = [ - # impermanence.nixosModules.impermanence - # ]; - # home-manager = { - # users.chris = import ./home; - # extraSpecialArgs = { - # inherit pkgs-unstable; - # inherit inputs; - # }; - # }; - #} ]; }; }; @@ -133,7 +363,6 @@ # chris = home-manager.lib.homeManagerConfiguration { # inherit pkgs; # extraSpecialArgs = { - # inherit pkgs-unstable; # inherit inputs; # }; # modules = [ diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 572db5a..5dcc062 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -4,28 +4,66 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-partlabel/disk-stationette-root"; - fsType = "btrfs"; + fileSystems."/" = { + device = "/dev/disk/by-partlabel/disk-stationette-root"; + fsType = "btrfs"; + options = [ "subvol=root" ]; }; - fileSystems."/boot" = - { device = "/dev/disk/by-partlabel/disk-stationette-ESP"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; + boot.initrd.postDeviceCommands = lib.mkAfter '' + mkdir /btrfs_tmp + mount /dev/disk/by-label/disk-stationette-root /btrfs_tmp + if [[ -e /btrfs_tmp/root ]]; then + mkdir -p /btrfs_tmp/old_roots + timestamp=$(dat +%Y-%m-%d_%H-%M-%S) + mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" + fi + + delete_subvolume_recursively() { + IFS=$'\n' + for i in $(btrfs subvolume list -o "$1" | cut -f 9 -d ' '); do + delete_subvolume_recursively "/btrfs_tmp/$i" + done + btrfs subvolume delete "$1" + } + + for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do + delete_subvolume_recursively "$i" + done + + btrfs subvolume create /btrfs_tmp/root + umount /btrfs_tmp + ''; + + fileSystems."/persist" = { + device = "/dev/disk/by-partlabel/disk-stationette-root"; + neededForBoot = true; + fsType = "btrfs"; + options = [ "subvol=persist" ]; }; - swapDevices = [ ]; + fileSystems."/nix" = { + device = "/dev/disk/by-partlabel/disk-stationette-root"; + neededForBoot = true; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + fileSystems."/boot" = { + device = "/dev/disk/by-partlabel/disk-stationette-ESP"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index 73e96c9..0000000 --- a/home/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs, - lib, - config, - pkgs, - pkgs-unstable, - ... -}: { - imports = [ - inputs.impermanence.nixosModules.home-manager.impermanence - ./user - ]; - - home = { - username = "chris"; - homeDirectory = "/home/chris"; - }; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "23.05"; -} diff --git a/home/user/default.nix b/home/user/default.nix deleted file mode 100644 index 2540643..0000000 --- a/home/user/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - imports = [ - ./packages.nix - ./programs.nix - ./scripts.nix - ]; - - nixpkgs = { - config = { - allowUnfree = true; - allowUnfreePredicate = (_: true); - - permittedInsecurePackages = [ - "electron-25.9.0" # Obsidian - "beekeeper-studio-5.3.4" - ]; - }; - }; -} diff --git a/home/user/impermanence.nix b/home/user/impermanence.nix deleted file mode 100644 index eb7e16e..0000000 --- a/home/user/impermanence.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - home.persistenec."/persist/home/chris" = { - directories = [ - "Downloads" - "Tower" - ".config/dotfiles" - ".local/share/direnv" - ".ssh" - ]; - "allowOther" = true; - }; -} diff --git a/home/user/packages.nix b/home/user/packages.nix deleted file mode 100644 index 5d0816d..0000000 --- a/home/user/packages.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ pkgs, pkgs-unstable, ... }: - -{ - home.packages = with pkgs; [ - # jetbrains.rider - # android-studio - # beekeeper-studio - # brave - # discord - # spotify - # go - # lua - # nodePackages.pnpm - # (python3.withPackages (python-pkgs: [ python-pkgs.pip python-pkgs.requests ])) - # rustup - # zig - # obsidian - # thunderbird - # libreoffice-qt - # pkgs-unstable.nerd-fonts.fira-code - # hunspell - # blueberry - # steam - # steam-run - # viewnior - # pkgs-unstable.hyprshot - # catppuccin-cursors.macchiatoBlue - # catppuccin-gtk - # papirus-folders - # pkgs-unstable.php84Packages.composer - # pkgs-unstable.php84Packages.xdebug - # pkgs-unstable.php84Extensions.sqlite3 - # pkgs-unstable.php84Extensions.redis - # pkgs-unstable.php84Extensions.sodium - # pkgs-unstable.php84Extensions.pgsql - # pkgs-unstable.php84Extensions.iconv - # pkgs-unstable.php84Extensions.gd - # pkgs-unstable.php84Extensions.zip - # php - # antigravity - # gimp - # kdePackages.dolphin - # enpass - # enpass-cli - # expressvpn - # jellyfin-ffmpeg - # inkscape - # krita - # libreoffice-fresh - # nextcloud-client - # nodejs_24 - # signal-desktop - # sxiv - # tenacity - # unzip - # zathura - # ghostty - # wally-cli - # kdePackages.wacomtablet - # kdePackages.print-manager - # mpv - # vlc - # telegram-desktop - ]; -} diff --git a/home/user/programs.nix b/home/user/programs.nix deleted file mode 100644 index 9bd5cc1..0000000 --- a/home/user/programs.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ pkgs, inputs, ... }: - -let - lock-false = { - Value = false; - Status = "locked"; - }; - lock-true = { - Value = true; - Status = "locked"; - }; -in - { - programs = { - # firefox = { - # enable = true; - # package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - # extraPolicies = { - # DisableTelemetry = true; - # DisableFirefoxStudies = true; - # EnableTrackingProtection = { - # Value= true; - # Locked = true; - # Cryptomining = true; - # Fingerprinting = true; - # }; - # DisablePocket = true; - # DisableFirefoxAccounts = true; - # DisableAccounts = true; - # DisableFirefoxScreenshots = true; - # OverrideFirstRunPage = ""; - # OverridePostUpdatePage = ""; - # DontCheckDefaultBrowser = true; - # DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" - # DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" - # SearchBar = "unified"; # alternative: "separate" - - # /* ---- EXTENSIONS ---- */ - # ExtensionSettings = { - # "*".installation_mode = "allowed"; # blocks all addons except the ones specified below - # # Enpass - # "firefox-enpass@enpass.io" = { - # install_url = "https://dl.enpass.io/stable/extensions/firefox/versions/v6.11.10.2/enpass_password_manager-6.11.10.2.xpi"; - # installation_mode = "force_installed"; - # }; - # }; - - # /* ---- PREFERENCES ---- */ - # # Set preferences shared by all profiles. - # Preferences = { - # "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; - # "extensions.pocket.enabled" = lock-false; - # "extensions.screenshots.disabled" = lock-true; - # "browser.topsites.contile.enabled" = lock-false; - # "browser.formfill.enable" = lock-false; - # "browser.search.suggest.enabled" = lock-false; - # "browser.search.suggest.enabled.private" = lock-false; - # "browser.urlbar.suggest.searches" = lock-false; - # "browser.urlbar.showSearchSuggestionsFirst" = lock-false; - # "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; - # "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; - # "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; - # "browser.newtabpage.activity-stream.showSponsored" = lock-false; - # "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; - # "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; - # }; - # }; - # }; - # }; - }; - programs.home-manager.enable = true; -} diff --git a/home/user/scripts.nix b/home/user/scripts.nix deleted file mode 100644 index 597b739..0000000 --- a/home/user/scripts.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - home.activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' - DOTFILES_DIR="$HOME/.config/dotfiles" - - if [ ! -d "$DOTFILES_DIR/.git" ]; then - if [[ -v DRY_RUN ]]; then - echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" - else - echo "Dotfiles not found. Running bootstrap script..." - - # Setup a temporary workspace - TEMP_DIR=$(mktemp -d) - - # Clone the repo (using the public URL for the initial pull) - ${pkgs.git}/bin/git clone -b main https://labs.scarif.space/chris/dotfiles.git "$TEMP_DIR" - - # Copy files to HOME - ${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME" - - # Initialize the separate git directory - ${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR" - cd "$HOME" - ${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME" - - # Update submodules - ${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git - ${pkgs.git}/bin/git submodule update --init - - # Set URLs back to SSH - ${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git - ${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git - - # Clean up - ${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR" - ${pkgs.coreutils}/bin/rm -f "$HOME/.git" - - echo "Dotfiles bootstrapped successfully." - fi - fi - ''; -} diff --git a/modules/boot.nix b/modules/boot.nix deleted file mode 100644 index fd825f4..0000000 --- a/modules/boot.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - initrd.postDeviceCommands = lib.mkAfter '' - mkdir /btrfs_tmp - mount /dev/disk/by-label/NIXOS /btrfs_tmp - if [[ -e /btrfs_tmp/root ]]; then - mkdir -p /btrfs_tmp/old_roots - timestamp=$(dat +%Y-%m-%d_%H-%M-%S) - mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" - fi - - delete_subvolume_recursively() { - IFS=$'\n' - for i in $(btrfs subvolume list -o "$1" | cut -f 9 -d ' '); do - delete_subvolume_recursively "/btrfs_tmp/$i" - done - btrfs subvolume delete "$1" - } - - for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do - delete_subvolume_recursively "$i" - done - - btrfs subvolume create /btrfs_tmp/root - umount /btrfs_tmp - ''; - }; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index 13bb138..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -{ - imports = [ - ./boot.nix - ./networking.nix - ./packages.nix - ./programs.nix - ./users.nix - ]; -} diff --git a/modules/impermanenc.nix b/modules/impermanenc.nix deleted file mode 100644 index 4ea3ef9..0000000 --- a/modules/impermanenc.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - environment.persistence."/persist" = { - hideMounts = true; - directories = [ - "/var/log" - "/var/lib/bluetooth" - "/var/lib/networkmanager" - "/etc/ssh" - ]; - files = [ - "/etc/machine-id" - ] - }; -} diff --git a/modules/networking.nix b/modules/networking.nix deleted file mode 100644 index 75d8175..0000000 --- a/modules/networking.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, pkgs, ... }: - -{ - networking = { - hostName = "stationette"; - networkmanager.enable = true; - }; -} diff --git a/modules/packages.nix b/modules/packages.nix deleted file mode 100644 index dccf895..0000000 --- a/modules/packages.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, pkgs, ... }: - -{ - environment.systemPackages = with pkgs; [ - bat - highlight - btop - eza - fzf - git - gnumake - neofetch - neovim - ripgrep - tldr - unzip - openssl - wget - zip - zoxide - jq - lazygit - lazysql - less - mlocate - tree - tmux - tmuxinator - wget - zenity - gum - yazi - rsync - p7zip - impala - ]; -} diff --git a/modules/programs.nix b/modules/programs.nix deleted file mode 100644 index cc1854e..0000000 --- a/modules/programs.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs = { - zsh = { - enable = true; - }; - }; -} diff --git a/modules/users.nix b/modules/users.nix deleted file mode 100644 index 95b0480..0000000 --- a/modules/users.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ - users.users.chris = { - isNormalUser = true; - shell = pkgs.zsh; - extraGroups = [ - "chris" - "wheel" - "networkmanager" - ]; - }; -}