This commit is contained in:
2026-02-28 14:33:47 +00:00
parent 9cd1adf12d
commit 24417bb1b8

590
flake.nix
View File

@@ -36,42 +36,43 @@
disko.devices = { disko.devices = {
disk = { disk = {
stationette = { stationette = {
type = "disk"; type = "disk";
device = "/dev/sda"; # Check this with lsblk device = "/dev/sda"; # Check this with lsblk
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
size = "512M"; size = "512M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "fmask=0022" "dmask=0022" "umask=0077" ]; mountOptions = [ "fmask=0022" "dmask=0022" "umask=0077" ];
};
}; };
}; root = {
root = { size = "100%";
size = "100%"; content = {
content = { type = "btrfs";
type = "btrfs"; extraArgs = [ "-f" ]; # Force overwrite
extraArgs = [ "-f" ]; # Force overwrite subvolumes = {
subvolumes = { "/root" = {
"/root" = { mountpoint = "/";
mountpoint = "/"; mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" ]; };
}; "/nix" = {
"/nix" = { mountpoint = "/nix";
mountpoint = "/nix"; mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" ]; };
}; "/persist" = {
"/persist" = { mountpoint = "/persist";
mountpoint = "/persist"; mountOptions = [ "compress=zstd" "noatime" ];
mountOptions = [ "compress=zstd" "noatime" ]; };
}; "/swap" = {
"/swap" = { mountpoint = "/.swapvol";
mountpoint = "/.swapvol"; swap.swapfile.size = "8G";
swap.swapfile.size = "8G"; };
}; };
}; };
}; };
@@ -80,295 +81,294 @@
}; };
}; };
}; };
}; boot.loader = {
boot.loader = { systemd-boot.enable = true;
systemd-boot.enable = true; efi.canTouchEfiVariables = true;
efi.canTouchEfiVariables = true; };
}; environment = {
environment = { persistence."/persist" = {
persistence."/persist" = { hideMounts = true;
hideMounts = true; directories = [
directories = [ "/var/log"
"/var/log" "/var/lib/bluetooth"
"/var/lib/bluetooth" "/var/lib/networkmanager"
"/var/lib/networkmanager" "/etc/ssh"
"/etc/ssh" ];
]; files = [
files = [ "/etc/machine-id"
"/etc/machine-id" ];
};
systemPackages = with pkgs; [
bat
#highlight
btop
eza
fzf
git
#gnumake
#neofetch
neovim
ripgrep
tldr
unzip
openssl
wget
zip
zoxide
jq
lazygit
#sqlit
less
mlocate
tree
tmux
tmuxinator
wget
zenity
gum
yazi
rsync
p7zip
impala
]; ];
}; };
systemPackages = with pkgs; [ networking = {
bat hostName = "stationette";
#highlight networkmanager.enable = true;
btop };
eza users.users.chris = {
fzf uid = 1000;
git isNormalUser = true;
#gnumake initialPassword = "changeme123";
#neofetch shell = pkgs.zsh;
neovim extraGroups = [
ripgrep "chris"
tldr "wheel"
unzip "networkmanager"
openssl ];
wget };
zip programs.zsh = {
zoxide enable = true;
jq };
lazygit
#sqlit
less
mlocate
tree
tmux
tmuxinator
wget
zenity
gum
yazi
rsync
p7zip
impala
];
};
networking = {
hostName = "stationette";
networkmanager.enable = true;
};
users.users.chris = {
uid = 1000;
isNormalUser = true;
initialPassword = "changeme123";
shell = pkgs.zsh;
extraGroups = [
"chris"
"wheel"
"networkmanager"
];
};
programs.zsh = {
enable = true;
};
system.stateVersion = "25.11"; system.stateVersion = "25.11";
home-manager = { home-manager = {
users.chris = { pkgs, lib, ... }: { users.chris = { pkgs, lib, ... }: {
home = { home = {
username = "chris"; username = "chris";
homeDirectory = "/home/chris"; homeDirectory = "/home/chris";
stateVersion = "25.11"; stateVersion = "25.11";
persistence."/persist" = { persistence."/persist" = {
directories = [ directories = [
"Downloads" "Downloads"
"Tower" "Tower"
".config/dotfiles" ".config/dotfiles"
".local/share/direnv" ".local/share/direnv"
".ssh" ".ssh"
]; ];
}; };
activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
if [[ -v DRY_RUN ]]; then if [[ -v DRY_RUN ]]; then
echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" echo "Dry run: Would bootstrap dotfiles from labs.scarif.space"
exit exit
fi fi
DOTFILES_DIR="$HOME/.config/dotfiles" DOTFILES_DIR="$HOME/.config/dotfiles"
if [ -d "$DOTFILES_DIR/.git" ]; then if [ -d "$DOTFILES_DIR/.git" ]; then
SOURCE="$DOTFILES_DIR/.git" SOURCE="$DOTFILES_DIR/.git"
else else
SOURCE="https://labs.scarif.space/chris/dotfiles.git" SOURCE="https://labs.scarif.space/chris/dotfiles.git"
# Initialize the separate git directory # Initialize the separate git directory
if [ ! -d "$DOTFILES_DIR" ]; then if [ ! -d "$DOTFILES_DIR" ]; then
${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR" ${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR"
fi fi
fi fi
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR" ${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME" ${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
cd "$HOME" cd "$HOME"
${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME" ${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME"
${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git ${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
${pkgs.git}/bin/git submodule update --init ${pkgs.git}/bin/git submodule update --init
${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git ${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 ${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git
# Clean up # Clean up
${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR" ${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR"
${pkgs.coreutils}/bin/rm -f "$HOME/.git" ${pkgs.coreutils}/bin/rm -f "$HOME/.git"
echo "Dotfiles bootstrapped successfully." echo "Dotfiles bootstrapped successfully."
''; '';
packages = with pkgs; [ packages = with pkgs; [
# jetbrains.rider # jetbrains.rider
# android-studio # android-studio
# beekeeper-studio # beekeeper-studio
# brave # brave
# discord # discord
# spotify # spotify
# go # go
# lua # lua
# nodePackages.pnpm # nodePackages.pnpm
# (python3.withPackages (python-pkgs: [ python-pkgs.pip python-pkgs.requests ])) # (python3.withPackages (python-pkgs: [ python-pkgs.pip python-pkgs.requests ]))
# rustup # rustup
# zig # zig
# obsidian # obsidian
# thunderbird # thunderbird
# libreoffice-qt # libreoffice-qt
# pkgs-unstable.nerd-fonts.fira-code # pkgs-unstable.nerd-fonts.fira-code
# hunspell # hunspell
# blueberry # blueberry
# steam # steam
# steam-run # steam-run
# viewnior # viewnior
# pkgs-unstable.hyprshot # pkgs-unstable.hyprshot
# catppuccin-cursors.macchiatoBlue # catppuccin-cursors.macchiatoBlue
# catppuccin-gtk # catppuccin-gtk
# papirus-folders # papirus-folders
# pkgs-unstable.php84Packages.composer # pkgs-unstable.php84Packages.composer
# pkgs-unstable.php84Packages.xdebug # pkgs-unstable.php84Packages.xdebug
# pkgs-unstable.php84Extensions.sqlite3 # pkgs-unstable.php84Extensions.sqlite3
# pkgs-unstable.php84Extensions.redis # pkgs-unstable.php84Extensions.redis
# pkgs-unstable.php84Extensions.sodium # pkgs-unstable.php84Extensions.sodium
# pkgs-unstable.php84Extensions.pgsql # pkgs-unstable.php84Extensions.pgsql
# pkgs-unstable.php84Extensions.iconv # pkgs-unstable.php84Extensions.iconv
# pkgs-unstable.php84Extensions.gd # pkgs-unstable.php84Extensions.gd
# pkgs-unstable.php84Extensions.zip # pkgs-unstable.php84Extensions.zip
# php # php
# antigravity # antigravity
# gimp # gimp
# kdePackages.dolphin # kdePackages.dolphin
# enpass # enpass
# enpass-cli # enpass-cli
# expressvpn # expressvpn
# jellyfin-ffmpeg # jellyfin-ffmpeg
# inkscape # inkscape
# krita # krita
# libreoffice-fresh # libreoffice-fresh
# nextcloud-client # nextcloud-client
# nodejs_24 # nodejs_24
# signal-desktop # signal-desktop
# sxiv # sxiv
# tenacity # tenacity
# unzip # unzip
# zathura # zathura
# ghostty # ghostty
# wally-cli # wally-cli
# kdePackages.wacomtablet # kdePackages.wacomtablet
# kdePackages.print-manager # kdePackages.print-manager
# mpv # mpv
# vlc # vlc
# telegram-desktop # 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"
]; ];
}; };
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;
}; };
}; };
extraSpecialArgs = { }
inherit inputs; ];
}; };
};
}
];
}; };
};
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
#homeConfigurations = { #homeConfigurations = {
# chris = home-manager.lib.homeManagerConfiguration { # chris = home-manager.lib.homeManagerConfiguration {
# inherit pkgs; # inherit pkgs;
# extraSpecialArgs = { # extraSpecialArgs = {
# inherit inputs; # inherit inputs;
# }; # };
# modules = [ # modules = [
# ./home # ./home
# ]; # ];
# }; # };
#}; #};
}; };
} }