Refactoring
This commit is contained in:
486
flake.nix
486
flake.nix
@@ -46,6 +46,7 @@
|
||||
home-manager,
|
||||
try-cli,
|
||||
voxtype,
|
||||
walker,
|
||||
# hyprland-preview-share-picker,
|
||||
...
|
||||
} @ inputs: let
|
||||
@@ -63,474 +64,47 @@
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
powerManagement.enable = true;
|
||||
systemd = {
|
||||
packages = with pkgs; [
|
||||
uwsm
|
||||
];
|
||||
settings = {
|
||||
Manager = {
|
||||
DefaultTimeoutStopSec = "5s";
|
||||
};
|
||||
};
|
||||
};
|
||||
environment = {
|
||||
pathsToLink = [
|
||||
"/share/uwsm"
|
||||
];
|
||||
};
|
||||
users.users.chris = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
initialPassword = "changeme123";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"chris"
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
];
|
||||
};
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
programs = {
|
||||
localsend = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
zsh = {
|
||||
enable = true;
|
||||
};
|
||||
hyprland = {
|
||||
enable = true;
|
||||
package = pkgs.writeShellScriptBin "hyprland" ''
|
||||
station-bg-random
|
||||
${pkgs-unstable.hyprland}/bin/Hyprland
|
||||
'';
|
||||
xwayland.enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
};
|
||||
system.stateVersion = "25.11";
|
||||
home-manager = {
|
||||
users.chris = { pkgs, lib, ... }: {
|
||||
xdg.configFile."voxtype/config.toml".enable = false;
|
||||
home = {
|
||||
file.".mozilla/firefox/default/search.json.mozlz4".force = lib.mkForce true;
|
||||
username = "chris";
|
||||
homeDirectory = "/home/chris";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
stateVersion = "25.11";
|
||||
persistence."/persist" = {
|
||||
directories = [
|
||||
"Downloads"
|
||||
"Tower"
|
||||
"Code"
|
||||
".steam"
|
||||
".config/dotfiles"
|
||||
".cache/zsh"
|
||||
".mozilla/firefox"
|
||||
".config/nvim"
|
||||
".config/yazi/plugins"
|
||||
".config/nixos"
|
||||
".config/sinew.in"
|
||||
".config/chromium"
|
||||
".local/share/direnv"
|
||||
".local/share/nvim"
|
||||
".local/share/voxtype"
|
||||
".local/share/zoxide"
|
||||
".local/share/Enpass"
|
||||
".local/share/Steam"
|
||||
".local/share/station"
|
||||
".local/state/station"
|
||||
".ssh"
|
||||
];
|
||||
files = [
|
||||
".config/shell/.env"
|
||||
];
|
||||
};
|
||||
activation = {
|
||||
setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo "Dry run: Would bootstrap dotfiles from labs.scarif.space"
|
||||
exit
|
||||
fi
|
||||
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
DOTFILES_DIR="$HOME/.config/dotfiles"
|
||||
DOTFILES_GIT_DIR="$DOTFILES_DIR/.git"
|
||||
|
||||
if [ ! -d "$DOTFILES_GIT_DIR" ]; then
|
||||
echo "No local repository so cloning from remote"
|
||||
SOURCE="https://labs.scarif.space/chris/dotfiles.git"
|
||||
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
|
||||
mv "$TEMP_DIR/.git" "$DOTFILES_GIT_DIR"
|
||||
else
|
||||
echo "Local repository found so cloning from there"
|
||||
${pkgs.git}/bin/git clone -b main "$DOTFILES_GIT_DIR" "$TEMP_DIR"
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$TEMP_DIR" pull --rebase || true
|
||||
fi
|
||||
|
||||
echo "Copying dot files to home"
|
||||
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
|
||||
|
||||
NVIM_DIR="$HOME/.config/nvim"
|
||||
echo "Neovim config not initialised so initialising from remote"
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule update --init || true
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
|
||||
|
||||
cd "$HOME"
|
||||
|
||||
echo "Cleanup"
|
||||
${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR"
|
||||
${pkgs.coreutils}/bin/rm -rf "$HOME/.git" || true
|
||||
|
||||
echo "Dotfiles bootstrapped successfully."
|
||||
'';
|
||||
setupDevDirectories = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo "Dry run: Would create dev directories"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Creating development directories"
|
||||
|
||||
for dir in "DevOps" "FSharp" "JavaScript" "Scala" "Rust" "PHP" "Tutorials" "Sites" "MobileApps" "Tries"; do
|
||||
if [ ! -d "$HOME/Code/$dir" ]; then
|
||||
mkdir -p "$HOME/Code/$dir"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
setupInitialConfigs = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo "Dry run: Would copy initial config files"
|
||||
exit
|
||||
fi
|
||||
|
||||
DEST_FILE="$HOME/.config/Nextcloud/nextcloud.cfg"
|
||||
|
||||
if [ ! -f "$DEST_FILE" ]; then
|
||||
cp "${./initial-configs/nextcloud.cfg}" "$DEST_FILE"
|
||||
fi
|
||||
|
||||
DEST_FILE="$HOME/.config/sinew.in/Enpass.conf"
|
||||
|
||||
if [ ! -f "$DEST_FILE" ]; then
|
||||
cp "${./initial-configs/Enpass.conf}" "$DEST_FILE"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
packages = with pkgs; [
|
||||
lunar-client
|
||||
direnv
|
||||
wiremix
|
||||
xournalpp
|
||||
bluetui
|
||||
spotify
|
||||
nodePackages.pnpm
|
||||
try-cli.packages.${system}.default
|
||||
obsidian
|
||||
mailspring
|
||||
antigravity
|
||||
gimp
|
||||
nautilus
|
||||
enpass
|
||||
enpass-cli
|
||||
expressvpn
|
||||
ffmpeg
|
||||
ffmpegthumbnailer
|
||||
gpu-screen-recorder
|
||||
inkscape
|
||||
krita
|
||||
libreoffice-fresh
|
||||
nextcloud-client
|
||||
nodejs_24
|
||||
signal-desktop
|
||||
sxiv
|
||||
tenacity
|
||||
zathura
|
||||
ghostty
|
||||
yarn
|
||||
uwsm
|
||||
wally-cli
|
||||
kdePackages.wacomtablet
|
||||
mpv
|
||||
vlc
|
||||
imv
|
||||
];
|
||||
};
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
# Directories
|
||||
"inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
||||
|
||||
# Images
|
||||
"image/png" = [ "imv.desktop" ];
|
||||
"image/jpeg" = [ "imv.desktop" ];
|
||||
"image/gif" = [ "imv.desktop" ];
|
||||
"image/webp" = [ "imv.desktop" ];
|
||||
"image/bmp" = [ "imv.desktop" ];
|
||||
"image/tiff" = [ "imv.desktop" ];
|
||||
|
||||
# Documents
|
||||
"application/pdf" = [ "zathura.desktop" ];
|
||||
|
||||
# Web and Browser
|
||||
"x-scheme-handler/http" = [ "firefox.desktop" ];
|
||||
"x-scheme-handler/https" = [ "firefox.desktop" ];
|
||||
"text/html" = [ "firefox.desktop" ];
|
||||
|
||||
# Video
|
||||
"video/mp4" = [ "mpv.desktop" ];
|
||||
"video/x-msvideo" = [ "mpv.desktop" ];
|
||||
"video/x-matroska" = [ "mpv.desktop" ];
|
||||
"video/x-flv" = [ "mpv.desktop" ];
|
||||
"video/x-ms-wmv" = [ "mpv.desktop" ];
|
||||
"video/mpeg" = [ "mpv.desktop" ];
|
||||
"video/ogg" = [ "mpv.desktop" ];
|
||||
"video/webm" = [ "mpv.desktop" ];
|
||||
"video/quicktime" = [ "mpv.desktop" ];
|
||||
"video/3gpp" = [ "mpv.desktop" ];
|
||||
"video/3gpp2" = [ "mpv.desktop" ];
|
||||
"video/x-ms-asf" = [ "mpv.desktop" ];
|
||||
"video/x-ogm+ogg" = [ "mpv.desktop" ];
|
||||
"video/x-theora+ogg" = [ "mpv.desktop" ];
|
||||
"application/ogg" = [ "mpv.desktop" ];
|
||||
|
||||
# Mail
|
||||
"x-scheme-handler/mailto" = [ "mailspring.desktop" ];
|
||||
|
||||
# Text and Code
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"text/english" = [ "nvim.desktop" ];
|
||||
"text/x-makefile" = [ "nvim.desktop" ];
|
||||
"text/x-c++hdr" = [ "nvim.desktop" ];
|
||||
"text/x-c++src" = [ "nvim.desktop" ];
|
||||
"text/x-chdr" = [ "nvim.desktop" ];
|
||||
"text/x-csrc" = [ "nvim.desktop" ];
|
||||
"text/x-java" = [ "nvim.desktop" ];
|
||||
"text/x-moc" = [ "nvim.desktop" ];
|
||||
"text/x-pascal" = [ "nvim.desktop" ];
|
||||
"text/x-tcl" = [ "nvim.desktop" ];
|
||||
"text/x-tex" = [ "nvim.desktop" ];
|
||||
"application/x-shellscript" = [ "nvim.desktop" ];
|
||||
"text/x-c" = [ "nvim.desktop" ];
|
||||
"text/x-c++" = [ "nvim.desktop" ];
|
||||
"application/xml" = [ "nvim.desktop" ];
|
||||
"text/xml" = [ "nvim.desktop" ];
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
inputs.walker.homeManagerModules.default
|
||||
inputs.voxtype.homeManagerModules.default
|
||||
];
|
||||
services = {
|
||||
swayosd.enable = true;
|
||||
};
|
||||
# systemd.user = {
|
||||
# enable = true;
|
||||
# timers = {
|
||||
# "station-battery-monitor" = {
|
||||
# wantedBy = [ "timers.target" ];
|
||||
# timerConfig = {
|
||||
# OnBootSec = "1min";
|
||||
# OnUnitActiveSec = "30sec";
|
||||
# Unit = "station-battery-monitor.service";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# services = {
|
||||
# "station-battery-monitor" = {
|
||||
# after = [ "graphical-session.target" ];
|
||||
# serviceConfig = {
|
||||
# Type = "oneshot";
|
||||
# ExecStart = "%h/.local/share/omarchy/bin/omarchy-battery-monitor";
|
||||
# Environment = "DISPLAY=:0";
|
||||
# LogLevelMax = "warning";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
programs = let
|
||||
lock-false = {
|
||||
Value = false;
|
||||
Status = "locked";
|
||||
};
|
||||
lock-true = {
|
||||
Value = true;
|
||||
Status = "locked";
|
||||
};
|
||||
in {
|
||||
walker = {
|
||||
enable = true;
|
||||
config = {};
|
||||
runAsService = true;
|
||||
};
|
||||
elephant = {
|
||||
enable = true;
|
||||
};
|
||||
voxtype = {
|
||||
enable = true;
|
||||
package = voxtype.packages.${system}.vulkan;
|
||||
service.enable = true;
|
||||
settings = {};
|
||||
};
|
||||
chromium = {
|
||||
enable = true;
|
||||
extensions = [
|
||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm"
|
||||
"kmcfomidfpdkfieipokbalgegidffkal"
|
||||
];
|
||||
extraOpts = {
|
||||
"BrowserSignin" = 0;
|
||||
"SyncDisabled" = true;
|
||||
"PasswordManagerEnabled" = false;
|
||||
"SpellcheckEnabled" = true;
|
||||
"SpellcheckLanguage" = [
|
||||
"en-GB"
|
||||
];
|
||||
};
|
||||
};
|
||||
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 = false;
|
||||
DisableAccounts = false;
|
||||
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;
|
||||
"browser.newtabpage.activity-stream.feeds.section.highlights" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
profiles = {
|
||||
default = {
|
||||
id = 0;
|
||||
name = "default";
|
||||
isDefault = true;
|
||||
search = {
|
||||
default = "holocron";
|
||||
order = [ "holocron" "google" ];
|
||||
engines= {
|
||||
holocron = {
|
||||
name = "Holocron";
|
||||
urls = [{
|
||||
template = "https://holocron.scarif.space/search";
|
||||
params = [
|
||||
{ name = "q"; value = "{searchTerms}"; }
|
||||
];
|
||||
}];
|
||||
icon = "https://holocron.scarif.space/favicon.ico";
|
||||
definedAliases = [ "@h" ];
|
||||
};
|
||||
bing.metaData.hidden = true;
|
||||
ebay.metaData.hidden = true;
|
||||
perplexity.metaData.hidden = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
allowUnfreePredicate = (_: true);
|
||||
|
||||
permittedInsecurePackages = [
|
||||
"electron-25.9.0" # Obsidian
|
||||
"beekeeper-studio-5.3.4"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
users.chris = import ./home;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit pkgs-unstable;
|
||||
inherit try-cli;
|
||||
inherit voxtype;
|
||||
inherit walker;
|
||||
inherit impermanence;
|
||||
};
|
||||
};
|
||||
system = {
|
||||
autoUpgrade = {
|
||||
enable = true;
|
||||
allowReboot = false;
|
||||
runGarbageCollection = true;
|
||||
};
|
||||
};
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
};
|
||||
hardware.bluetooth.enable = true;
|
||||
}
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit pkgs-unstable;
|
||||
inherit impermanence;
|
||||
inherit disko;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
#homeConfigurations = {
|
||||
# chris = home-manager.lib.homeManagerConfiguration {
|
||||
# inherit pkgs;
|
||||
# extraSpecialArgs = {
|
||||
# inherit inputs;
|
||||
# };
|
||||
# modules = [
|
||||
# ./home
|
||||
# ];
|
||||
# };
|
||||
#};
|
||||
homeConfigurations = {
|
||||
chris = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit pkgs-unstable;
|
||||
inherit try-cli;
|
||||
inherit voxtype;
|
||||
inherit walker;
|
||||
inherit impermanence;
|
||||
};
|
||||
modules = [
|
||||
./home
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nix.settings = {
|
||||
extra-substituters = [
|
||||
"https://walker.cachix.org"
|
||||
|
||||
100
home/default.nix
Normal file
100
home/default.nix
Normal file
@@ -0,0 +1,100 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./packages.nix
|
||||
./programs.nix
|
||||
];
|
||||
home = {
|
||||
username = "chris";
|
||||
homeDirectory = "/home/chris";
|
||||
enableNixpkgsReleaseCheck = false;
|
||||
stateVersion = "25.11";
|
||||
};
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
# Directories
|
||||
"inode/directory" = [ "org.gnome.Nautilus.desktop" ];
|
||||
|
||||
# Images
|
||||
"image/png" = [ "imv.desktop" ];
|
||||
"image/jpeg" = [ "imv.desktop" ];
|
||||
"image/gif" = [ "imv.desktop" ];
|
||||
"image/webp" = [ "imv.desktop" ];
|
||||
"image/bmp" = [ "imv.desktop" ];
|
||||
"image/tiff" = [ "imv.desktop" ];
|
||||
|
||||
# Documents
|
||||
"application/pdf" = [ "zathura.desktop" ];
|
||||
|
||||
# Web and Browser
|
||||
"x-scheme-handler/http" = [ "firefox.desktop" ];
|
||||
"x-scheme-handler/https" = [ "firefox.desktop" ];
|
||||
"text/html" = [ "firefox.desktop" ];
|
||||
|
||||
# Video
|
||||
"video/mp4" = [ "mpv.desktop" ];
|
||||
"video/x-msvideo" = [ "mpv.desktop" ];
|
||||
"video/x-matroska" = [ "mpv.desktop" ];
|
||||
"video/x-flv" = [ "mpv.desktop" ];
|
||||
"video/x-ms-wmv" = [ "mpv.desktop" ];
|
||||
"video/mpeg" = [ "mpv.desktop" ];
|
||||
"video/ogg" = [ "mpv.desktop" ];
|
||||
"video/webm" = [ "mpv.desktop" ];
|
||||
"video/quicktime" = [ "mpv.desktop" ];
|
||||
"video/3gpp" = [ "mpv.desktop" ];
|
||||
"video/3gpp2" = [ "mpv.desktop" ];
|
||||
"video/x-ms-asf" = [ "mpv.desktop" ];
|
||||
"video/x-ogm+ogg" = [ "mpv.desktop" ];
|
||||
"video/x-theora+ogg" = [ "mpv.desktop" ];
|
||||
"application/ogg" = [ "mpv.desktop" ];
|
||||
|
||||
# Mail
|
||||
"x-scheme-handler/mailto" = [ "mailspring.desktop" ];
|
||||
|
||||
# Text and Code
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"text/english" = [ "nvim.desktop" ];
|
||||
"text/x-makefile" = [ "nvim.desktop" ];
|
||||
"text/x-c++hdr" = [ "nvim.desktop" ];
|
||||
"text/x-c++src" = [ "nvim.desktop" ];
|
||||
"text/x-chdr" = [ "nvim.desktop" ];
|
||||
"text/x-csrc" = [ "nvim.desktop" ];
|
||||
"text/x-java" = [ "nvim.desktop" ];
|
||||
"text/x-moc" = [ "nvim.desktop" ];
|
||||
"text/x-pascal" = [ "nvim.desktop" ];
|
||||
"text/x-tcl" = [ "nvim.desktop" ];
|
||||
"text/x-tex" = [ "nvim.desktop" ];
|
||||
"application/x-shellscript" = [ "nvim.desktop" ];
|
||||
"text/x-c" = [ "nvim.desktop" ];
|
||||
"text/x-c++" = [ "nvim.desktop" ];
|
||||
"application/xml" = [ "nvim.desktop" ];
|
||||
"text/xml" = [ "nvim.desktop" ];
|
||||
};
|
||||
};
|
||||
# systemd.user = {
|
||||
# enable = true;
|
||||
# timers = {
|
||||
# "station-battery-monitor" = {
|
||||
# wantedBy = [ "timers.target" ];
|
||||
# timerConfig = {
|
||||
# OnBootSec = "1min";
|
||||
# OnUnitActiveSec = "30sec";
|
||||
# Unit = "station-battery-monitor.service";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# services = {
|
||||
# "station-battery-monitor" = {
|
||||
# after = [ "graphical-session.target" ];
|
||||
# serviceConfig = {
|
||||
# Type = "oneshot";
|
||||
# ExecStart = "%h/.local/share/omarchy/bin/omarchy-battery-monitor";
|
||||
# Environment = "DISPLAY=:0";
|
||||
# LogLevelMax = "warning";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
}
|
||||
77
home/hooks.nix
Normal file
77
home/hooks.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
activation = {
|
||||
setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo "Dry run: Would bootstrap dotfiles from labs.scarif.space"
|
||||
exit
|
||||
fi
|
||||
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
|
||||
DOTFILES_DIR="$HOME/.config/dotfiles"
|
||||
DOTFILES_GIT_DIR="$DOTFILES_DIR/.git"
|
||||
|
||||
if [ ! -d "$DOTFILES_GIT_DIR" ]; then
|
||||
echo "No local repository so cloning from remote"
|
||||
SOURCE="https://labs.scarif.space/chris/dotfiles.git"
|
||||
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
|
||||
mv "$TEMP_DIR/.git" "$DOTFILES_GIT_DIR"
|
||||
else
|
||||
echo "Local repository found so cloning from there"
|
||||
${pkgs.git}/bin/git clone -b main "$DOTFILES_GIT_DIR" "$TEMP_DIR"
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$TEMP_DIR" pull --rebase || true
|
||||
fi
|
||||
|
||||
echo "Copying dot files to home"
|
||||
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
|
||||
|
||||
NVIM_DIR="$HOME/.config/nvim"
|
||||
echo "Neovim config not initialised so initialising from remote"
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule update --init || true
|
||||
${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
|
||||
|
||||
cd "$HOME"
|
||||
|
||||
echo "Cleanup"
|
||||
${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR"
|
||||
${pkgs.coreutils}/bin/rm -rf "$HOME/.git" || true
|
||||
|
||||
echo "Dotfiles bootstrapped successfully."
|
||||
'';
|
||||
setupDevDirectories = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo "Dry run: Would create dev directories"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Creating development directories"
|
||||
|
||||
for dir in "DevOps" "FSharp" "JavaScript" "Scala" "Rust" "PHP" "Tutorials" "Sites" "MobileApps" "Tries"; do
|
||||
if [ ! -d "$HOME/Code/$dir" ]; then
|
||||
mkdir -p "$HOME/Code/$dir"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
setupInitialConfigs = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo "Dry run: Would copy initial config files"
|
||||
exit
|
||||
fi
|
||||
|
||||
DEST_FILE="$HOME/.config/Nextcloud/nextcloud.cfg"
|
||||
|
||||
if [ ! -f "$DEST_FILE" ]; then
|
||||
cp "${./initial-configs/nextcloud.cfg}" "$DEST_FILE"
|
||||
fi
|
||||
|
||||
DEST_FILE="$HOME/.config/sinew.in/Enpass.conf"
|
||||
|
||||
if [ ! -f "$DEST_FILE" ]; then
|
||||
cp "${./initial-configs/Enpass.conf}" "$DEST_FILE"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
33
home/impermanence.nix
Normal file
33
home/impermanence.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ impermanence, ... }:
|
||||
|
||||
{
|
||||
imports = [ impermanence.nixosModules.impermanence ];
|
||||
home.persistence."/persist" = {
|
||||
directories = [
|
||||
"Downloads"
|
||||
"Tower"
|
||||
"Code"
|
||||
".steam"
|
||||
".config/dotfiles"
|
||||
".cache/zsh"
|
||||
".mozilla/firefox"
|
||||
".config/nvim"
|
||||
".config/yazi/plugins"
|
||||
".config/nixos"
|
||||
".config/sinew.in"
|
||||
".config/chromium"
|
||||
".local/share/direnv"
|
||||
".local/share/nvim"
|
||||
".local/share/voxtype"
|
||||
".local/share/zoxide"
|
||||
".local/share/Enpass"
|
||||
".local/share/Steam"
|
||||
".local/share/station"
|
||||
".local/state/station"
|
||||
".ssh"
|
||||
];
|
||||
files = [
|
||||
".config/shell/.env"
|
||||
];
|
||||
};
|
||||
}
|
||||
48
home/packages.nix
Normal file
48
home/packages.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{ pkgs, try-cli, ... }:
|
||||
|
||||
{
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
allowUnfreePredicate = (_: true);
|
||||
|
||||
permittedInsecurePackages = [
|
||||
"electron-25.9.0" # Obsidian
|
||||
"beekeeper-studio-5.3.4"
|
||||
];
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
antigravity # Gemini AI coding assistant
|
||||
bluetui # Bluetooth TUI
|
||||
direnv # Directory environment manager
|
||||
enpass # Password manager
|
||||
enpass-cli # Enpass CLI tool
|
||||
expressvpn # VPN
|
||||
ffmpeg # Video tools
|
||||
ffmpegthumbnailer # Video thumbnailer
|
||||
ghostty # Terminal emulator
|
||||
gimp # Image manipulation software
|
||||
gpu-screen-recorder # GPU screen recorder for Linux
|
||||
imv # Image viewer
|
||||
inkscape # Vector graphics software
|
||||
kdePackages.wacomtablet # Wacom tablet manager
|
||||
krita # Digital art software
|
||||
libreoffice-fresh # Office suite
|
||||
lunar-client # Minecraft launcher
|
||||
mailspring # Mail client
|
||||
mpv # Video player
|
||||
nautilus # Document viewer
|
||||
nextcloud-client # Nextcloud sync client
|
||||
obsidian # Notes software
|
||||
signal-desktop # Messaging
|
||||
spotify # Music
|
||||
sxiv # Minimal image viewer
|
||||
tenacity # Audio software
|
||||
try-cli.packages.${pkgs.system}.default # Try CLI tool
|
||||
wally-cli # Keyboard flasher
|
||||
wiremix # Audio mixer TUI
|
||||
xournalpp # Handwriting note-taking software
|
||||
zathura # Minimal PDF viewer
|
||||
];
|
||||
}
|
||||
128
home/programs.nix
Normal file
128
home/programs.nix
Normal file
@@ -0,0 +1,128 @@
|
||||
{ pkgs, lib, voxtype, walker, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
walker.homeManagerModules.default
|
||||
voxtype.homeManagerModules.default
|
||||
];
|
||||
programs = let
|
||||
lock-false = {
|
||||
Value = false;
|
||||
Status = "locked";
|
||||
};
|
||||
lock-true = {
|
||||
Value = true;
|
||||
Status = "locked";
|
||||
};
|
||||
in {
|
||||
walker = {
|
||||
enable = true;
|
||||
config = {};
|
||||
runAsService = true;
|
||||
};
|
||||
elephant = {
|
||||
enable = true;
|
||||
};
|
||||
voxtype = {
|
||||
enable = true;
|
||||
package = voxtype.packages.${pkgs.system}.vulkan;
|
||||
service.enable = true;
|
||||
settings = {};
|
||||
};
|
||||
chromium = {
|
||||
enable = true;
|
||||
extensions = [
|
||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm"
|
||||
"kmcfomidfpdkfieipokbalgegidffkal"
|
||||
];
|
||||
};
|
||||
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 = false;
|
||||
DisableAccounts = false;
|
||||
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;
|
||||
"browser.newtabpage.activity-stream.feeds.section.highlights" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
profiles = {
|
||||
default = {
|
||||
id = 0;
|
||||
name = "default";
|
||||
isDefault = true;
|
||||
search = {
|
||||
default = "holocron";
|
||||
order = [ "holocron" "google" ];
|
||||
engines= {
|
||||
holocron = {
|
||||
name = "Holocron";
|
||||
urls = [{
|
||||
template = "https://holocron.scarif.space/search";
|
||||
params = [
|
||||
{ name = "q"; value = "{searchTerms}"; }
|
||||
];
|
||||
}];
|
||||
icon = "https://holocron.scarif.space/favicon.ico";
|
||||
definedAliases = [ "@h" ];
|
||||
};
|
||||
bing.metaData.hidden = true;
|
||||
ebay.metaData.hidden = true;
|
||||
perplexity.metaData.hidden = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg.configFile."voxtype/config.toml".enable = false;
|
||||
home.file.".mozilla/firefox/default/search.json.mozlz4".force = lib.mkForce true;
|
||||
}
|
||||
7
home/services.nix
Normal file
7
home/services.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services = {
|
||||
swayosd.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{ impermanence, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
@@ -50,5 +50,13 @@
|
||||
bootspec.enable = true;
|
||||
resumeDevice = "/dev/disk/by-partlabel/disk-stationette-root";
|
||||
};
|
||||
|
||||
systemd = {
|
||||
settings = {
|
||||
Manager = {
|
||||
DefaultTimeoutStopSec = "5s";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,9 @@
|
||||
./networking.nix
|
||||
./packages.nix
|
||||
./services.nix
|
||||
]
|
||||
./users.nix
|
||||
./programs.nix
|
||||
./fonts.nix
|
||||
./hardware.nix
|
||||
];
|
||||
}
|
||||
|
||||
10
system/fonts.nix
Normal file
10
system/fonts.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.fira-code
|
||||
];
|
||||
};
|
||||
}
|
||||
12
system/hardware.nix
Normal file
12
system/hardware.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware = {
|
||||
bluetooth.enable = true;
|
||||
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, pkgs-unstable, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
# hyprland-preview-share-picker.packages.${system}.default # Hyprland share picker TODO: Figure out and configure
|
||||
bat # Better cat
|
||||
brightnessctl # Backlight control
|
||||
btop # Resource monitor
|
||||
@@ -20,7 +22,6 @@
|
||||
hyprlock # Screen locker for Hyprland
|
||||
hyprpaper # Wallpaper utility for Hyprland TODO: Check if necessary with swaybg
|
||||
hyprpicker # Hyprland colour picker
|
||||
# hyprland-preview-share-picker.packages.${system}.default # Hyprland share picker TODO: Figure out and configure
|
||||
imagemagick # Image manipulation tool
|
||||
impala # Wifi TUI
|
||||
jq # CLI JSON processor
|
||||
@@ -30,6 +31,8 @@
|
||||
makima # Key remapper for Linux TODO: Figure out and configure
|
||||
mako # Notification daemon
|
||||
neovim # Editor
|
||||
nodePackages.pnpm # JavaScript package manager (used by Neovim plugins)
|
||||
nodejs_24 # JavaScript runtime
|
||||
openssl # SSL/TLS toolkit
|
||||
p7zip # 7-Zip archiver
|
||||
pkgs-unstable.yazi # Terminal file manager
|
||||
@@ -53,7 +56,22 @@
|
||||
wl-clipboard # Wayland clipboard manager
|
||||
wlogout # Wayland logout menu
|
||||
xdg-terminal-exec # XDG terminal execution utility
|
||||
yarn # JavaScript package manager
|
||||
zip # Archiver tool
|
||||
zoxide # Better cd
|
||||
];
|
||||
|
||||
systemd = {
|
||||
packages = with pkgs; [
|
||||
uwsm
|
||||
];
|
||||
};
|
||||
|
||||
system = {
|
||||
autoUpgrade = {
|
||||
enable = true;
|
||||
allowReboot = false;
|
||||
runGarbageCollection = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
44
system/programs.nix
Normal file
44
system/programs.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ pkgs, pkgs-unstable, ... }:
|
||||
|
||||
{
|
||||
|
||||
programs = {
|
||||
# Easy file sharing on local network
|
||||
localsend = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
zsh = {
|
||||
enable = true;
|
||||
};
|
||||
hyprland = {
|
||||
enable = true;
|
||||
package = pkgs-unstable.hyprland;
|
||||
xwayland.enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
chromium = {
|
||||
enable = true;
|
||||
extraOpts = {
|
||||
"BrowserSignin" = 0;
|
||||
"SyncDisabled" = true;
|
||||
"PasswordManagerEnabled" = false;
|
||||
"SpellcheckEnabled" = true;
|
||||
"SpellcheckLanguage" = [
|
||||
"en-GB"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
environment = {
|
||||
pathsToLink = [
|
||||
"/share/uwsm"
|
||||
];
|
||||
};
|
||||
}
|
||||
15
system/users.nix
Normal file
15
system/users.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.chris = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
initialPassword = "changeme123";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"chris"
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user