Compare commits

...

2 Commits

Author SHA1 Message Date
0bfdb5858c Super simplify 2026-02-27 00:51:33 +00:00
e847828109 Simplifying 2026-02-26 23:27:43 +00:00
20 changed files with 492 additions and 514 deletions

99
flake.lock generated
View File

@@ -2,9 +2,7 @@
"nodes": {
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs-unstable"
]
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1768920986,
@@ -21,12 +19,32 @@
"type": "github"
}
},
"home-manager": {
"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=",
@@ -42,10 +60,31 @@
"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": [],
"nixpkgs": []
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1769548169,
@@ -62,28 +101,60 @@
}
},
"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": {
@@ -96,10 +167,10 @@
"root": {
"inputs": {
"disko": "disko",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"impermanence": "impermanence",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
"nixpkgs": "nixpkgs_4"
}
}
},

383
flake.nix
View File

@@ -2,60 +2,354 @@
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,
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 = [
./system/configuration.nix
disko.nixModules.disko
import ./system/disko.nix
./hardware-configuration.nix
disko.nixosModules.disko
impermanence.nixosModules.impermanence
home-manager.nixosModules.home-manager
{
imports = [
impermanence.nixModules.impermanence
home-manager.nixModules.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 = {
type = "disk";
device = "/dev/sda"; # Check this with lsblk
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Force overwrite
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "8G";
};
};
};
};
};
};
};
};
};
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 = import ./home;
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 pkgs-unstable;
inherit inputs;
};
};
@@ -65,17 +359,16 @@
};
# Standalone home-manager configuration entrypoint
homeConfigurations = {
chris = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit pkgs-unstable;
inherit inputs;
};
modules = [
./home
];
};
};
#homeConfigurations = {
# chris = home-manager.lib.homeManagerConfiguration {
# inherit pkgs;
# extraSpecialArgs = {
# inherit inputs;
# };
# modules = [
# ./home
# ];
# };
#};
};
}

View File

@@ -0,0 +1,69 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
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 = [ ];
fileSystems."/" = {
device = "/dev/disk/by-partlabel/disk-stationette-root";
fsType = "btrfs";
options = [ "subvol=root" ];
};
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" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-partlabel/disk-stationette-root";
neededForBoot = true;
fsType = "btrfs";
options = [ "subvol=nix" ];
};
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;
}

View File

@@ -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";
}

View File

@@ -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"
];
};
};
}

View File

@@ -1,12 +0,0 @@
{
home.persistenec."/persist/home/chris" = {
directories = [
"Downloads"
"Tower"
".config/dotfiles"
".local/share/direnv"
".ssh"
];
"allowOther" = true;
};
}

View File

@@ -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
];
}

View File

@@ -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;
}

View File

@@ -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
'';
}

View File

@@ -1,15 +0,0 @@
{
inputs,
lib,
config,
pkgs,
...
}: {
imports = [
./hardware-configuration.nix
./modules
];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "25.11";
}

View File

@@ -1,48 +0,0 @@
# nix --extra-experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ./disko.nix
{
disko.devices = {
disk = {
stationette = {
type = "disk";
device = "/dev/sda"; # Check this with lsblk
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EFOO";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
type = "btfs";
extraArgs = [ "-f" ]; # Force overwrite
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "8G";
};
};
};
};
};
};
};
};
}

View File

@@ -1,31 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
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 = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/c425db8f-455a-4fec-8a24-72cd670640cb";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/038B-4974";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -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
'';
};
}

View File

@@ -1,11 +0,0 @@
{ ... }:
{
imports = [
./boot.nix
./networking.nix
./packages.nix
./programs.nix
./users.nix
];
}

View File

@@ -1,14 +0,0 @@
{
environment.persistence."/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/networkmanager"
"/etc/ssh"
];
files = [
"/etc/machine-id"
]
};
}

View File

@@ -1,8 +0,0 @@
{ config, pkgs, ... }:
{
networking = {
hostName = "stationette";
networkmanager.enable = true;
};
}

View File

@@ -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
];
}

View File

@@ -1,9 +0,0 @@
{ config, pkgs, ... }:
{
programs = {
zsh = {
enable = true;
};
};
}

View File

@@ -1,13 +0,0 @@
{ config, pkgs, ... }:
{
users.users.chris = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"chris"
"wheel"
"networkmanager"
];
};
}