diff --git a/.guide/README.md b/.guide/README.md new file mode 100644 index 0000000..6805421 --- /dev/null +++ b/.guide/README.md @@ -0,0 +1,27 @@ +# What do? + +Hi there, if you are not a member of the Serenity Amalgam, +feel free to do as you wish with these configs. + +--- + +Otherwise if you& are a member of the Serenity Amalgam, +then please follow this guide to enroll an account. + +To get started, add a user by typing +`micro home/users/users.nix`, copy the template in the +'users.users' block and adjust it to match, then repeat +with the 'home-manager' block below that, then finally +add a $-username.nix file in home/users by copying the +existing template and adding whatever you& wish. + +A suite of programs and applications has been provided +via a shared home.nix file, as well as a common config +across machines and users. +If you& would like to see what is included by default, +then Serenity's account is considered common/shared by +all members of the amalgam. + +Please do not add or remove entries outside of these +mentioned locations, +thankyou& <3 diff --git a/README.md b/README.md index 46223ba..539797a 100644 --- a/README.md +++ b/README.md @@ -2,60 +2,98 @@ To Do: > in order of priority - - [ ] learn home manager (seriously wtf ???) + - [ ] become more learn-ed in the ways of nix-fu - - [X] build hyprland **branch** - - [ ] get it working, stable, etc - - [ ] build minimal fallback gnome branch - - [ ] get flake to actually build + - [ ] get flake to actually build + - [ ] repair config after merge with updated #core branch + + - [X] build "core" branch for all variant flakes to build upon + - [ ] finish separating home/ and core/ packages & programs + - [ ] change one 'branch' & respective git branch at a time + - [ ] merge updated aspects of core branch into hyprland branch + + - [ ] hybrid shared/multi-user home-manager configuration + - [ ] functional + + - [ ] build minimal fallback gnome branch - [ ] per host hardware configurations - [ ] Hades - - [X] Proserpina - - - [ ] (+ per host theming) + - [ ] adjust Hades' configs + - [X] Proserpina + - [ ] per host themes + - [ ] Hades + - [ ] Proserpina + --- -WIP Flake structure +WIP Flake Structure ``` . -├── README.md ├── core │ ├── configuration -│ ├── packages +│ └── packages +├── flake +├── home +│ ├── git +│ ├── fish +│ ├── kitty +│ ├── hyprland +│ ├── theme +│ │ └── resources │ └── users +└── hosts + ├── hades + └── proserpina +``` +--- +``` +. +├── core +│ ├── configuration.nix +│ └── packages.nix ├── flake.lock ├── flake.nix ├── home │ ├── home.nix +│ ├── git.nix +│ ├── fish.nix +│ ├── kitty.nix │ ├── hyprland -│ │ ├── dunst -│ │ ├── hyprcursor -│ │ ├── hypridle -│ │ ├── hyprland -│ │ ├── hyprlock -│ │ ├── hyprpaper -│ │ ├── waybar -│ │ ├── wlogout -│ │ └── wofi -│ ├── git -│ ├── fish -│ ├── kitty -│ └── theme -│ ├── SerenityOS -│ ├── config -│ └── resources -│ ├── icons -│ └── wallpapers +│ │ ├── hyprcursor.nix +│ │ ├── hyprpaper.nix +│ │ ├── hypridle.nix +│ │ ├── hyprland.nix +│ │ ├── hyprlock.nix +│ │ ├── wlogout.nix +│ │ ├── waybar.nix +│ │ ├── wofi.nix +│ │ └── dunst.nix +│ ├── theme +│ │ ├── SerenityOS.nix +│ │ ├── config +│ │ │ └── template.nix +│ │ └── resources +│ │ ├── icons +│ │ └── wallpapers +│ └── users +│ ├── users.nix +│ ├── u-template.nix +│ ├── u-coffee.nix +│ └── u-serenity.nix └── hosts + ├── hades + │ ├─ configuration.nix + │ ├─ disko-config.nix + │ ├── hardware-configuration.nix + │ └── network-configuration.nix └── proserpina - ├── configuration - ├── disko-config - ├── hardware-configuration - └── network-configuration - + ├── configuration.nix + ├── disko-config.nix + ├── hardware-configuration.nix + └── network-configuration.nix ``` diff --git a/core/configuration.nix b/core/configuration.nix index 6be7fb7..b532556 100644 --- a/core/configuration.nix +++ b/core/configuration.nix @@ -14,7 +14,7 @@ inputs.home-manager.nixosModules.home-manager # also split up configuration.nix and import pieces: - ./users.nix + ../home/users ./packages.nix ]; @@ -75,7 +75,7 @@ ]; }; - # services.flatpak.enable = true; + services.flatpak.enable = true; boot.binfmt.registrations.appimage = { wrapInterpreterInShell = false; diff --git a/core/packages.nix b/core/packages.nix index 6f6e186..6b463e2 100644 --- a/core/packages.nix +++ b/core/packages.nix @@ -3,7 +3,6 @@ { programs = { - # hyprland.enable = true; traceroute.enable = true; starship.enable = true; fish.enable = true; @@ -16,7 +15,6 @@ environment.systemPackages = with pkgs; [ ## nixos - appimage-run # nix-tree # nix-init # nix-index @@ -27,6 +25,7 @@ udiskie ntfs3g xfsprogs +<<<<<<< HEAD ## compositor waybar @@ -50,6 +49,18 @@ tldr wget curl +======= + + ## tools + fd + bc + gcc + tldr + wget + curl + file + zip +>>>>>>> origin/core-merge unzip gnupg blueman @@ -63,16 +74,6 @@ libsecret git-crypt - ## web browsers - # tor-browser-bundle-bin - # lagrange - # firefox - - ## misc, libraries, maybe more, - # qt5-wayland - # qt6-wayland - glib - ]; fonts = { diff --git a/flake.lock b/flake.lock index bd9fa75..36ced86 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,6 @@ { "nodes": { +<<<<<<< HEAD "base16-schemes": { "flake": false, "locked": { @@ -16,6 +17,8 @@ "type": "github" } }, +======= +>>>>>>> origin/core-merge "disko": { "inputs": { "nixpkgs": [ @@ -36,6 +39,7 @@ "type": "github" } }, +<<<<<<< HEAD "flake-compat": { "flake": false, "locked": { @@ -59,6 +63,15 @@ "owner": "nixos", "repo": "nixos-hardware", "rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c", +======= + "hardware": { + "locked": { + "lastModified": 1712566108, + "narHash": "sha256-c9nT2ZODGqobISP41kUwCQ84Srwg7a/1TmPFQuol2/8=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "1e3b3a35b7083f4152f5a516798cf9b21e686465", +>>>>>>> origin/core-merge "type": "github" }, "original": { @@ -74,11 +87,19 @@ ] }, "locked": { +<<<<<<< HEAD "lastModified": 1712390667, "narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=", "owner": "nix-community", "repo": "home-manager", "rev": "b787726a8413e11b074cde42704b4af32d95545c", +======= + "lastModified": 1712462372, + "narHash": "sha256-WA3bbBWhd3o1wAgyHZNypjb/LG4oq+IWxFq8ey8yNPU=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "a561ad6ab38578c812cc9af3b04f2cc60ebf48c9", +>>>>>>> origin/core-merge "type": "github" }, "original": { @@ -87,6 +108,7 @@ "type": "github" } }, +<<<<<<< HEAD "hyprcursor": { "inputs": { "hyprlang": "hyprlang", @@ -315,6 +337,22 @@ "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" +======= + "nixpkgs": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" +>>>>>>> origin/core-merge } }, "root": { @@ -322,6 +360,7 @@ "disko": "disko", "hardware": "hardware", "home-manager": "home-manager", +<<<<<<< HEAD "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", "nix-colors": "nix-colors", @@ -428,6 +467,9 @@ "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", "type": "github" +======= + "nixpkgs": "nixpkgs" +>>>>>>> origin/core-merge } } }, diff --git a/flake.nix b/flake.nix index aa6411f..5c06cb0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,12 @@ { - description = "SerenityOS v0.3.61"; + description = "SerenityOS v0.3.65"; inputs = { # Nixpkgs + # there was a way to have unstable as an overlay, + # will set it back up, lazy rn, for now pick one + # nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; hardware.url = "github:nixos/nixos-hardware"; @@ -70,3 +73,4 @@ }; } + diff --git a/home/home.nix b/home/home.nix index 93ff1f6..acfbb57 100644 --- a/home/home.nix +++ b/home/home.nix @@ -8,6 +8,7 @@ }: { imports = [ +<<<<<<< HEAD ./hyprland ./theme ./kitty.nix @@ -16,16 +17,45 @@ ]; home = { - username = "serenity"; - homeDirectory = "/home/serenity"; packages = with pkgs; [ - vlc - vscode - discord - firefox - obsidian + ## nixos + appimage-run + + ## desktop xfce.thunar + # gnome.nautilus ? + + ## web browsers + firefox + lagrange + tor + + ## chat & comms + discord + # fractal + # schildichat + + ## personal + obsidian + + ## terminal & coding + vscode + micro + kitty + ## utility + # insert terminal utility here + ## novelty + pipes + cbonsai + hyfetch + cmatrix + peaclock + + ## misc, libraries, maybe more, + # qt5-wayland + # qt6-wayland + glib ]; stateVersion = "23.11"; diff --git a/home/users/default.nix b/home/users/default.nix new file mode 100644 index 0000000..180798b --- /dev/null +++ b/home/users/default.nix @@ -0,0 +1,16 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + + imports = [ + ./users.nix + ]; + +} diff --git a/home/users/u-coffee.nix b/home/users/u-coffee.nix new file mode 100644 index 0000000..5a504f4 --- /dev/null +++ b/home/users/u-coffee.nix @@ -0,0 +1,22 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + + imports = [ + inputs.home-manager.nixosModules.default + ../home.nix + ]; + + home = { + + packages = with pkgs; [ + + ]; + }; + +} diff --git a/home/users/u-serenity.nix b/home/users/u-serenity.nix new file mode 100644 index 0000000..5f5722c --- /dev/null +++ b/home/users/u-serenity.nix @@ -0,0 +1,22 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + + imports = [ + # inputs.home-manager.nixosModules.default + ../home.nix + ]; + + home = { + + packages = with pkgs; [ + + ]; + }; + +} diff --git a/home/users/u-template.nix b/home/users/u-template.nix new file mode 100644 index 0000000..acc412c --- /dev/null +++ b/home/users/u-template.nix @@ -0,0 +1,24 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + + imports = [ + inputs.home-manager.nixosModules.default + ../home.nix + ]; + + home = { + + packages = with pkgs; [ + + ]; + }; + +} diff --git a/home/users/users.nix b/home/users/users.nix new file mode 100644 index 0000000..9ca3b3a --- /dev/null +++ b/home/users/users.nix @@ -0,0 +1,89 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + + imports = [ + inputs.home-manager.nixosModules.default + ]; + + users.users = { + + # TEMPLATE = { + # description = "TEMPLATE"; + # isNormalUser = true; + ## be sure to change this with 'passwd' + # initialPassword = "password"; + # shell = pkgs.fish; + # extraGroups = [ + # "wheel" + # "networkmanager" + # ]; + # }; + + # coffee = { + # description = "Coffee Beans"; + # isNormalUser = true; + ## be sure to change this with 'passwd' + # initialPassword = "password"; + # shell = pkgs.fish; + # extraGroups = [ + # "wheel" + # "networkmanager" + # ]; + # }; + + serenity = { + description = "Serenity Amalgam"; + isNormalUser = true; + ## be sure to change this with 'passwd' + initialPassword = "password"; + shell = pkgs.fish; + extraGroups = [ + "wheel" + "networkmanager" + ]; + }; + + }; + + home-manager = { + extraSpecialArgs = { inherit inputs outputs; }; + useGlobalPkgs = true; + useUserPackages = true; + users = { + + # TEMPLATE = { + # imports = [ ./u-template.nix ]; + # home = { + # username = "TEMPLATE"; + # homeDirectory = "/home/TEMPLATE"; + # }; + # }; + + # coffee = { + # imports = [ ./u-coffee.nix ]; + # home = { + # username = "coffee"; + # homeDirectory = "/home/coffee"; + # }; + # }; + + serenity = { + imports = [ ./u-serenity.nix ]; + home = { + username = "serenity"; + homeDirectory = "/home/serenity"; + }; + }; + + }; + }; + +} diff --git a/hosts/hades/configuration.nix b/hosts/hades/configuration.nix new file mode 100644 index 0000000..10f8ad7 --- /dev/null +++ b/hosts/hades/configuration.nix @@ -0,0 +1,74 @@ +{ inputs, outputs, config, lib, pkgs, ... }: + +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + # "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" + ./disko-config.nix + ./network-configuration.nix + ../../core/configuration.nix + + ]; + + # Enable swap on luks + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 5; + }; + efi = { + canTouchEfiVariables = true; + # efiSysMountPoint = "/boot/efi"; + }; + }; + initrd = { + systemd.enable = true; + secrets = { + # "crypto_keyfile.bin" = null; + }; + luks = { + # devices."luks-DISK_UUID" = { + # device = "/dev/disk/by-uuid/DISK_UUID"; + # keyfile = "/crypto_keyfile.bin"; + # }; + }; + }; + }; + + services.fstrim.enable = true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + hardware = { + + cpu.intel.updateMicrocode = true; + enableAllFirmware = false; + bluetooth.enable = true; + + opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-compute-runtime + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + }; + + }; + + nix = { + # settings = { + # }; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 2d"; + persistent = true; + }; + }; + +} diff --git a/hosts/hades/disko-config.nix b/hosts/hades/disko-config.nix new file mode 100644 index 0000000..06b376d --- /dev/null +++ b/hosts/hades/disko-config.nix @@ -0,0 +1,66 @@ +{ + + disko.devices = { + disk = { + sda = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + + luks = { + size = "100%"; + content = { + type = "luks"; + name = "pomegranate"; + # disable settings.keyFile if you want to use interactive password entry + #passwordFile = "/tmp/secret.key"; # Interactive + settings = { + allowDiscards = true; + #keyFile = "/tmp/secret.key"; + }; + # additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; + + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + + }; + }; + + }; + }; + }; + }; + + }; + +} diff --git a/hosts/hades/hardware-configuration.nix b/hosts/hades/hardware-configuration.nix new file mode 100644 index 0000000..1e02223 --- /dev/null +++ b/hosts/hades/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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") + # ./disko-config.sh + ./disko-config.nix + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hades/network-configuration.nix b/hosts/hades/network-configuration.nix new file mode 100644 index 0000000..eb93781 --- /dev/null +++ b/hosts/hades/network-configuration.nix @@ -0,0 +1,72 @@ +{ pkgs, lib, config, ... }: + +{ + + imports = [ + # ./file.nix + ]; + + networking = { + hostName = "proserpina"; + wireless.enable = false; + networkmanager = { + enable = true; + }; + # nameservers = [ + # "1.1.1.1" + # ]; + }; + + # networking.proxy = { + # default = "https://user:password@proxy:port/"; + # noProxy = "127.0.0.1, localhost, internal.comain"; + # }; + + networking.firewall = { + enable = false; + # checkReversePath = "loose"; + # allowedTCPPorts = [ 22000 21027 25565 ]; + # allowedUDPPorts = [ 22000 21027 41641 51820 ]; + # allowedTCPPortRanges = [ + # { from = 9999; to = 9999; } # KDE COnnect + # { from = 9999; to = 9999; } # Nicotine+ + # ]; + # allowedUDPPortRanges = [ + # { from = 9999; to = 9999; } # KDE COnnect + # ]; + # interfaces."DEVICENAME".allowedTCPPorts = [ 22999 ] + }; + + services.syncthing = { + enable = false; + dataDir = "/home/serenity/"; + configDir = "/home/serenity/.config/syncthing"; + user = "serenity"; + settings.devices = { + + # hades.id = "DEVICE_ID"; + # proserpina.id = "DEVICE_ID"; + # hecate.id = "DEVICE_ID"; + + }; + settings.folders = { + + # "FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" "proserpina" ]; + # }; + + # "FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" "proserpina" ]; + # }; + + # "FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" "proserpina" ]; + # }; + + }; + }; + +} diff --git a/hosts/proserpina/configuration.nix b/hosts/proserpina/configuration.nix index 61809a4..d92d726 100644 --- a/hosts/proserpina/configuration.nix +++ b/hosts/proserpina/configuration.nix @@ -7,7 +7,6 @@ # "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" ./disko-config.nix # ./network-configuration.nix - ../../core/configuration.nix ]; @@ -80,6 +79,5 @@ }; }; - system.stateVersion = "23.11"; } diff --git a/hosts/proserpina/hardware-configuration.nix b/hosts/proserpina/hardware-configuration.nix index 29fd4bc..5d0c99c 100644 --- a/hosts/proserpina/hardware-configuration.nix +++ b/hosts/proserpina/hardware-configuration.nix @@ -7,6 +7,7 @@ imports = [ (modulesPath + "/installer/scan/not-detected.nix") + ./disko-config.nix ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];