Compare commits

..

No commits in common. "1b0e09b029dda36d89797da509bc056be5cca8a0" and "fcb256eb2bba783de0ac8c77516eb01fecfa4c3c" have entirely different histories.

53 changed files with 138 additions and 283 deletions

View file

@ -1,67 +0,0 @@
# My NixOS Dotfiles
This is my current multi-system NixOS configuration.
## File Structure
### `lib/`
This defines two helper functions that make it easier to create configurations in the `flake`:
1. `mkHome`: Creates a Home Manager configuration (for managing user-specific settings and packages)
2. `mkLinuxSystem`: Creates a NixOS system configuration (for managing system-wide settings)
Both functions take some modules (configuration files) as input and set up the necessary environment with some default settings, like allowing unfree packages and passing through important variables (inputs, config, etc.).
### `modules/config/`
This defines a configuration schema or template for managing various aspects of the system:
1. `people`: Creates records for user accounts, their SSH keys, emails, etc.
2. `services`: Creates records for various services with their domains, hostnames, SSL certificates, etc.
3. `machines`: Creates records for different devices with their mount points, IP addresses, and storage configurations
4. `aesthetics`: Creates records for visual appearance settings like fonts, colours, and cursor properties
It's essentially creating a structured way to organize abstracted configuration data that is declared in multiple places throughout the system configuration.
### `modules/home/`
This defines home environment configurations for different users across different machines in a multi-user, multi-device setup. It's using NixOS's home-manager functionality to manage user-specific configurations. Essentially, this is a configuration file that determines which software and configurations each user gets on each machine, allowing for personalized but reproducible user environments across the system.
### `modules/nixos/`
This defines a set of NixOS modules that are used to configure different systems. Each system has its own set of module imports that define what features or services are enabled on that system, as well as some shared modules. The file uses a helper function `directoryImport` (imported from ../helpers.nix) to import all the module definitions from the current directory. This allows for modular system configuration where different machines can easily inherit different sets of features and services. These modules are used in the `flake`.
### `parts/`
This defines the development environment configuration for the project, which includes:
1. `devshells`: Creates a default development shell with several development tools.
2. `pre-commit`: Creates pre-commit hooks that run before git commits.
This setup ensures that anyone working on this project has access to the same development tools and follows the same code formatting and commit message standards.
### `profiles/`
This defines NIxOS user configurations and their respective homes. Each profile is designed to be imported into each system configuration via the `flake`, with different settings and tools based on the user's needs and preferences. It also uses `systemd.tmpfiles` to declare custom home folder structures.
### `secrets/`
This contains encrypted secrets and credentials using `sops-nix`. This is a security-sensitive file that should be handled carefully as it contains encrypted credentials for multiple services and systems.
### `systems/`
This defines the system configurations for different machines. Each machine has similar configuration structure but with specific customizations. The system naming schema follows a celestial convention, with desktops being named after planets, laptops after moons, and servers after dwarf planets. The `fileSystems` configurations include helper functions for easily configuring mounts for internal storage, Synology, and samba drives.
### `templates/`
This defines flake-based development environment templates for projects written in different programming languages, such as Elm and Haskell. This setup also makes use of `devshells` and is designed for developers who want to quickly bootstrap projects with a complete development environment using Nix for reproducibility and dependency management.
### `flake.nix`
This defines the core of the NixOS configuration using helper functions from `lib/`, which is organized as a flake-parts-based structure for better modularity:
1. `inputs`: Declares all external dependencies including, such as core Nix components (`nixpkgs`, `flake-parts`, `systems`) and user environment components (`home-manager`, `sops-nix`).
2. `outputs`: Uses flake-parts to organize system configurations for multiple machines (`mars`, `venus`, `deimos`, `charon`, and `ceres`) and shared modules (`core`, `mantle`, `crust`) imported across systems.
Each system imports specialized modules and user profiles based on its intended purpose and users, creating a flexible but consistent configuration framework across multiple machines.

View file

@ -74,11 +74,11 @@
{ config, ... }:
{
nixosConfigurations = {
mars = inputs.self.lib.mkLinuxSystem [
./systems/mars
jupiter = inputs.self.lib.mkLinuxSystem [
./systems/jupiter
./profiles/user0
./profiles/user1
config.nixosModules.mars
config.nixosModules.jupiter
config.nixosModules.core
config.nixosModules.mantle
config.nixosModules.crust
@ -89,10 +89,10 @@
inputs.sops-nix.nixosModules.sops
inputs.nixvim.nixosModules.nixvim
];
venus = inputs.self.lib.mkLinuxSystem [
./systems/venus
saturn = inputs.self.lib.mkLinuxSystem [
./systems/saturn
./profiles/user2
config.nixosModules.venus
config.nixosModules.saturn
config.nixosModules.core
config.nixosModules.mantle
config.nixosModules.crust
@ -100,11 +100,11 @@
inputs.lix-module.nixosModules.default
inputs.sops-nix.nixosModules.sops
];
deimos = inputs.self.lib.mkLinuxSystem [
./systems/deimos
ganymede = inputs.self.lib.mkLinuxSystem [
./systems/ganymede
./profiles/user0
./profiles/user1
config.nixosModules.deimos
config.nixosModules.ganymede
config.nixosModules.core
config.nixosModules.mantle
config.nixosModules.crust
@ -113,10 +113,10 @@
inputs.nur.modules.nixos.default
inputs.sops-nix.nixosModules.sops
];
charon = inputs.self.lib.mkLinuxSystem [
./systems/charon
callisto = inputs.self.lib.mkLinuxSystem [
./systems/callisto
./profiles/user1
config.nixosModules.charon
config.nixosModules.callisto
config.nixosModules.core
config.nixosModules.crust
inputs.home-manager.nixosModules.home-manager

View file

@ -5,8 +5,8 @@ let
;
in
{
label = "Charon";
name = "charon";
label = "Callisto";
name = "callisto";
sync = {
address0 = "";
};

View file

@ -5,8 +5,8 @@ let
;
in
{
label = "Deimos";
name = "deimos";
label = "Ganymede";
name = "ganymede";
sync = {
address0 = "";
};

View file

@ -6,8 +6,8 @@ let
;
in
{
label = "Mars";
name = "mars";
label = "Jupiter";
name = "jupiter";
sync = {
address0 = "";
};

View file

@ -8,8 +8,8 @@ let
in
{
label = "Venus";
name = "venus";
label = "Saturn";
name = "saturn";
ip = {
address0 = "192.168.58.104";
};

View file

@ -11,7 +11,7 @@ let
user0Name = "Nick";
user1Name = "Garnet";
synologyName = "synology";
synologyIP = "192.168.50.210";
synologyIP = "192.168.50.209";
in
{
label = "Synology";

View file

@ -0,0 +1,16 @@
{ devicesFunctions }:
let
inherit (devicesFunctions)
dummy
;
in
{
name = "tablet";
label = dummy;
sync = {
address0 = "I2ZSCZU-T4JMUJJ-XCUQ3MY-G5EUFZ5-KRG2DRY-XIBJZZM-FQW3UMY-CBCTUQU";
};
ip = {
address0 = "192.168.50.189";
};
}

View file

@ -1,11 +0,0 @@
{
pkgs,
...
}:
{
home.packages = builtins.attrValues {
inherit (pkgs)
usbutils
;
};
}

View file

@ -7,16 +7,16 @@ in
flake.homeModules =
let
inherit (config.machines.devices)
charon
mars
venus
deimos
callisto
jupiter
saturn
ganymede
ceres
;
inherit (config.people) user0 user1 user2;
in
{
"${mars.name}-${user0}" = {
"${jupiter.name}-${user0}" = {
imports = builtins.attrValues {
inherit (modules)
cli
@ -52,11 +52,10 @@ in
hypr
wayland
theming
polychromatic
;
};
};
"${mars.name}-${user1}" = {
"${jupiter.name}-${user1}" = {
imports = builtins.attrValues {
inherit (modules)
cli
@ -77,7 +76,7 @@ in
;
};
};
"${venus.name}-${user2}" = {
"${saturn.name}-${user2}" = {
imports = builtins.attrValues {
inherit (modules)
cli
@ -107,7 +106,7 @@ in
;
};
};
"${deimos.name}-${user0}" = {
"${ganymede.name}-${user0}" = {
imports = builtins.attrValues {
inherit (modules)
cli
@ -124,7 +123,7 @@ in
;
};
};
"${deimos.name}-${user1}" = {
"${ganymede.name}-${user1}" = {
imports = builtins.attrValues {
inherit (modules)
cli
@ -145,7 +144,7 @@ in
;
};
};
"${charon.name}-${user1}" = {
"${callisto.name}-${user1}" = {
imports = builtins.attrValues {
inherit (modules)
cli

View file

@ -32,7 +32,7 @@
"floorp.browser.tabs.openNewTabPosition" = 1;
"services.sync.prefs.sync.floorp.browser.note.memos" = false;
"floorp.disable.fullscreen.notification" = true;
"floorp.browser.user.interface" = 1;
"floorp.browser.user.interface" = 8;
"browser.newtabpage.activity-stream.floorp.background.type" = 0;
"browser.startup.homepage" = "chrome://browser/content/blanktab.html";
"browser.newtabpage.enabled" = false;

View file

@ -93,78 +93,3 @@
visibility: visible !important;
opacity: 1 !important;
}
/* One-Line Tweak */
:root {
--navbarWidth: clamp(300px, 30vw, 30vw);
--animationSpeed: 0.15s;
}
/* Oneline tweak */
#TabsToolbar {
margin-left: var(--navbarWidth) !important;
}
#nav-bar {
margin-right: calc(100vw - var(--navbarWidth)) !important;
}
#urlbar-container {
min-width: 0px !important;
}
:root[uidensity="compact"] #nav-bar {
margin-top: -37px !important;
height: 37px !important;
}
:root:not([uidensity="compact"]):not([uidensity="touch"]) #nav-bar {
margin-top: -44px !important;
height: 44px !important;
}
:root[uidensity="touch"] #nav-bar {
margin-top: -49px !important;
height: 49px !important;
}
/* Dragging space */
:root[sizemode="maximized"] #TabsToolbar {
margin-top: 1px;
}
#TabsToolbar {
margin-top: 5px;
}
/* Simplifying interface */
#nav-bar {
background: none !important;
box-shadow: none !important;
}
#navigator-toolbox {
border: none !important;
}
.titlebar-spacer {
display: none !important;
}
#urlbar-background {
border: none !important;
}
#urlbar:not(:hover):not([breakout][breakout-extend])>#urlbar-background {
box-shadow: none !important;
background: none !important;
}
/* Add tab width constraints */
.tabbrowser-tab {
min-width: 80px !important;
max-width: 150px !important;
}

View file

@ -1,11 +0,0 @@
{
pkgs,
...
}:
{
home.packages = builtins.attrValues {
inherit (pkgs)
polychromatic
;
};
}

View file

@ -43,7 +43,7 @@ let
"PageUp, exec, playerctl next"
"PageDown, exec, playerctl previous"
"Home, exec, playerctl play-pause"
"Space, exec, rm -r /home/$USER/.cache/tofi* ; tofi-drun"
"Space, workspace, previous"
];
superShiftBinds = builtins.map (x: "SUPER SHIFT, " + x) [
@ -57,14 +57,15 @@ let
"T, exec, ghostty"
"S, exec, flameshot gui"
"period, exec, emote"
"Space, exec, rm -r /home/$USER/.cache/tofi* ; tofi-drun"
"Tab, fullscreen, 0"
"Backspace, layoutmsg, togglesplit"
"P, pin, enable"
"F, togglefloating"
# "Print, exec, grim -g \"$(slurp)\""
# Utility
"End, exec, shutdown now"
"Insert, exec, systemctl reboot"
"End, exec, hyprctl dispatch exit"
"Insert, exec, reboot now"
"Home, exec, swaylock"
];
superCtrlBinds = builtins.map (x: "SUPER CTRL, " + x) [

View file

@ -105,8 +105,8 @@ in
tooltip = false;
format-muted = " Muted";
on-click = "easyeffects";
on-scroll-up = "pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y818KFJ0C671CE-00.HiFi__Line1__sink +5% ; pamixer -i 5";
on-scroll-down = "pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y818KFJ0C671CE-00.HiFi__Line1__sink -5% ; pamixer -d 5";
on-scroll-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
on-scroll-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
scroll-step = 5;
format-icons = {
headphone = "";

View file

@ -3,7 +3,7 @@
enable = true;
settings = {
"default" = {
path = "~/Files/Projects/dotfiles/modules/home/gui/desktop/wayland/wpaperd/wallpaper";
path = "~/Files/Projects/dotfiles/home/modules/gui/desktop/wayland/wpaperd/wallpaper";
apply-shadow = true;
duration = "1m";
sorting = "random";

View file

@ -9,10 +9,10 @@ let
devices
;
hostname = config.networking.hostName;
mars = devices.mars.name;
jupiter = devices.jupiter.name;
ceres = devices.ceres.name;
venus = devices.venus.names;
charon = devices.charon.name;
saturn = devices.saturn.names;
callisto = devices.callisto.name;
in
{
security = {
@ -24,13 +24,13 @@ in
noPass = true;
users = [
(
if hostname == mars then
if hostname == jupiter then
user0
else if hostname == ceres then
user0
else if hostname == charon then
else if hostname == callisto then
user1
else if hostname == venus then
else if hostname == saturn then
user2
else
""

View file

@ -16,24 +16,24 @@ let
devices
;
hostname = config.networking.hostName;
mars = devices.mars.name;
jupiter = devices.jupiter.name;
ceres = devices.ceres.name;
venus = devices.venus.name;
charon = devices.charon.name;
saturn = devices.saturn.name;
callisto = devices.callisto.name;
userLogic =
if hostname == mars then
if hostname == jupiter then
user0
else if hostname == ceres then
user0
else if hostname == venus then
else if hostname == saturn then
user2
else
"";
in
{
users.users =
if hostname == charon then
if hostname == callisto then
{ }
else
{

View file

@ -4,7 +4,7 @@ let
in
{
flake.nixosModules = {
mars = {
jupiter = {
imports = builtins.attrValues {
inherit (modules)
mullvad
@ -17,7 +17,7 @@ in
};
};
venus = {
saturn = {
imports = builtins.attrValues {
inherit (modules)
plasma
@ -27,7 +27,7 @@ in
};
};
deimos = {
ganymede = {
imports = builtins.attrValues {
inherit (modules)
gnome

View file

@ -4,22 +4,9 @@
adb.enable = true;
droidcam.enable = true;
};
services.udev = {
enable = true;
packages = builtins.attrValues {
inherit (pkgs)
android-udev-rules
;
};
extraRules = ''
# Amazon Fire Tablet
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", ATTR{idProduct}=="0632", MODE="0666", GROUP="adbusers"
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", ATTR{idProduct}=="0632", SYMLINK+="android_adb"
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", ATTR{idProduct}=="0632", SYMLINK+="android_fastboot"
# General Android rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0666", GROUP="adbusers"
'';
services.udev.packages = builtins.attrValues {
inherit (pkgs)
android-udev-rules
;
};
}

View file

@ -7,6 +7,19 @@
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.extraConfig.bluetoothEnhancements = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [
"hsp_hs"
"hsp_ag"
"hfp_hf"
"hfp_ag"
];
};
};
};
pulseaudio.enable = false;
};

View file

@ -1,3 +0,0 @@
{
hardware.openrazer.enable = true;
}

View file

@ -6,7 +6,7 @@
}:
let
inherit (flake.config.machines.devices)
mars
jupiter
ceres
;
inherit (flake.config.services.instances)
@ -63,7 +63,7 @@ in
user = service.name;
}
// (
if hostname == mars.name then
if hostname == jupiter.name then
{
models = service.paths.path1;
# acceleration = "rocm";
@ -98,7 +98,7 @@ in
systemd.tmpfiles.rules = [
(
if hostname == mars.name then
if hostname == jupiter.name then
"Z ${service.paths.path1} 0777 ${service.name} ${service.name} -"
else
"Z ${service.paths.path0} 0755 ${service.name} ${service.name} -"

View file

@ -39,6 +39,14 @@ in
];
id = phone.sync.address0;
};
${tablet.name} = {
autoAcceptFolders = true;
name = tablet.name;
addresses = [
"tcp://${tablet.ip.address0}:${toString service.ports.port2}"
];
id = tablet.sync.address0;
};
};
};
};

View file

@ -8,17 +8,17 @@ let
devices
;
hostname = config.networking.hostName;
mars = devices.mars.name;
jupiter = devices.jupiter.name;
ceres = devices.ceres.name;
venus = devices.venus.name;
charon = devices.charon.name;
saturn = devices.saturn.name;
callisto = devices.callisto.name;
userLogic =
if hostname == mars then
if hostname == jupiter then
user0
else if hostname == ceres then
user0
else if hostname == venus then
else if hostname == saturn then
user2
else
"";
@ -32,7 +32,7 @@ in
generateKey = false;
};
secrets =
if hostname == charon then
if hostname == callisto then
{ }
else
{

View file

@ -31,7 +31,6 @@ in
"networkmanager"
"nextcloud"
"ollama"
"plugdev"
"postgres"
"redis-mastodon"
"samba"

View file

@ -5,7 +5,7 @@ vpnoff:
sudo protonvpn d
rebuild:
nixos-rebuild switch --use-remote-sudo --flake ~/Files/Projects/dotfiles#mars --show-trace
nixos-rebuild switch --use-remote-sudo --flake ~/Files/Projects/dotfiles#jupiter --show-trace
elm:
cd ~/Files/Projects/website/frontend; elm-land server

View file

@ -5,7 +5,7 @@
}:
let
inherit (flake.config.people) user1;
inherit (flake.config.machines.devices) charon;
inherit (flake.config.machines.devices) callisto;
in
{
fileSystems = {
@ -16,7 +16,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/1703-D452";
fsType = "vfat";
options = charon.boot.options;
options = callisto.boot.options;
};
};

View file

@ -5,12 +5,12 @@
}:
let
inherit (flake.config.machines.devices)
charon
callisto
;
in
{
networking = {
hostName = charon.name;
hostName = callisto.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;

View file

@ -9,7 +9,7 @@ let
user1
;
inherit (flake.config.machines.devices)
deimos
ganymede
synology
ceres
;
@ -63,7 +63,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/C506-9E18";
fsType = "vfat";
options = deimos.boot.options;
options = ganymede.boot.options;
};
}
// (builtins.listToAttrs (map synologyMounts synologyDrives))

View file

@ -5,12 +5,12 @@
}:
let
inherit (flake.config.machines.devices)
deimos
ganymede
;
in
{
networking = {
hostName = deimos.name;
hostName = ganymede.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;

View file

@ -2,7 +2,7 @@
let
configPath = ./config;
deimosImports =
ganymedeImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
@ -11,7 +11,7 @@ let
);
in
{
imports = deimosImports;
imports = ganymedeImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -9,7 +9,7 @@ let
user1
;
inherit (flake.config.machines.devices)
mars
jupiter
ceres
synology
;
@ -50,11 +50,11 @@ in
};
storageMounts = storageDrive: {
name = "${mars.${storageDrive}.mount}";
name = "${jupiter.${storageDrive}.mount}";
value = {
device = mars.${storageDrive}.device;
device = jupiter.${storageDrive}.device;
fsType = "ext4";
options = mars.${storageDrive}.options;
options = jupiter.${storageDrive}.options;
};
};
@ -77,7 +77,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/F095-17B7";
fsType = "vfat";
options = mars.boot.options;
options = jupiter.boot.options;
};
}
// (builtins.listToAttrs (map synologyMounts synologyDrives))
@ -91,8 +91,8 @@ in
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
"Z ${config.home-manager.users.${user1}.home.homeDirectory} 0755 ${user1} users -"
"Z ${mars.storage0.mount} 0755 ${user0} users -"
"Z ${mars.storage1.mount} 0755 ${user0} users -"
"Z ${jupiter.storage0.mount} 0755 ${user0} users -"
"Z ${jupiter.storage1.mount} 0755 ${user0} users -"
];
services.udisks2.enable = true;

View file

@ -5,12 +5,12 @@
}:
let
inherit (flake.config.machines.devices)
mars
jupiter
;
in
{
networking = {
hostName = mars.name;
hostName = jupiter.name;
networkmanager.enable = true;
nftables.enable = true;
useDHCP = lib.mkDefault true;
@ -22,8 +22,7 @@ in
2234 # Soulseek
3131 # Deskreen
1234 # Elm-land server
5037 # ADB Server
52006
55473
];
};
};

View file

@ -2,7 +2,7 @@
let
configPath = ./config;
marsImports =
jupiterImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
@ -11,7 +11,7 @@ let
);
in
{
imports = marsImports;
imports = jupiterImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}

View file

@ -5,7 +5,7 @@
}:
let
inherit (flake.config.people) user2;
inherit (flake.config.machines.devices) venus;
inherit (flake.config.machines.devices) saturn;
in
{
imports = [ ];
@ -18,11 +18,11 @@ in
];
storageMounts = storage: {
name = "${venus.${storage}.mount}";
name = "${saturn.${storage}.mount}";
value = {
device = venus.${storage}.device;
device = saturn.${storage}.device;
fsType = "ext4";
options = venus.${storage}.options;
options = saturn.${storage}.options;
};
};
in
@ -34,7 +34,7 @@ in
"/boot" = {
device = "/dev/disk/by-uuid/22BD-5A25";
fsType = "vfat";
options = venus.boot.options;
options = saturn.boot.options;
};
}
// (builtins.listToAttrs (map storageMounts storageDrives));
@ -45,8 +45,8 @@ in
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user2}.home.homeDirectory} 0755 ${user2} users -"
"Z ${venus.storage0.mount} 0755 ${user2} users -"
"Z ${venus.storage1.mount} 0755 ${user2} users -"
"Z ${saturn.storage0.mount} 0755 ${user2} users -"
"Z ${saturn.storage1.mount} 0755 ${user2} users -"
];
services.udisks2.enable = true;

View file

@ -4,11 +4,11 @@
...
}:
let
inherit (flake.config.machines.devices) venus;
inherit (flake.config.machines.devices) saturn;
in
{
networking = {
hostName = venus.name;
hostName = saturn.name;
networkmanager.enable = true;
useDHCP = lib.mkDefault true;
firewall = {

View file

@ -5,7 +5,7 @@
let
configPath = ./config;
venusImports =
saturnImports =
let
files = builtins.attrNames (builtins.readDir configPath);
in
@ -14,7 +14,7 @@ let
);
in
{
imports = venusImports;
imports = saturnImports;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
system.stateVersion = lib.mkForce "24.05";
}