diff --git a/TODO.md b/TODO.md index 84860e2..56b97d2 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,15 @@ -#### To Do --- - - [ ] trim down and remove old configuration options for GDM/GNOME - - [ ] steal, i mean, uh, look at, other creature's nixos/hyprland setups - - [ ] build minimal system base configuration around hyprland +#### To Do + +--- + + - [?] trim down and remove old configuration options for GDM/GNOME + - [?] steal, i mean, uh, look at, other creature's nixos/hyprland setups + - [ ] build ~~minimal~~ system-framework/scaffolding for configuration around hyprland - [ ] build user configuration - [ ] optional multi-user support - [ ] get flake to actually build - [ ] select media for wallpapers, avatars, etc. - [ ] uhhh, so much + - [ ] once hades is on nix, have specialised configs for each machine (duh) diff --git a/configuration.nix b/configuration.nix index c9b4c8a..8d9adac 100755 --- a/configuration.nix +++ b/configuration.nix @@ -2,11 +2,8 @@ { imports = [ - # ./packages - # ./packages.nix - # ./users.nix - # ./desktops/gnome/gnome.nix - # + ./home + ./modules ]; nixpkgs.config = { @@ -151,20 +148,23 @@ # nix-init # web browsers - # firefox + firefox # lagrange tor-browser-bundle-bin # misc/Fonts (unstable.nerdfonts.override { fonts = ["NerdFontsSymbolsOnly"]; }) + + # terminal stuff + kitty + micro + hyfetch - # cli + # cli utilities file zip unzip gnupg - micro - hyfetch busybox killall usbutils diff --git a/flake.nix b/flake.nix index 96c09e6..663acf7 100644 --- a/flake.nix +++ b/flake.nix @@ -2,26 +2,39 @@ description = "Serenity's NixOS configuration"; inputs = { - # Nixpkgs and home mananger + + # Nixpkgs and hardware specific configs nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; - home-manager.url = "github:nix-community/home-manager/release-23.11"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - # Hardware specific configuration stuff nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - # Packages - # apoth-admin.url = "git+https://codeberg.org/Apothecary/apoth-admin.git"; - # apoth-admin.inputs.nixpkgs.follows = "nixpkgs-unstable"; + + # nixos user repository ? :o + nur.url "git:nix-community/NUR"; + + # nix gaming ? + nix-gaming.url = "github:fufexan/nix-gaming"; + + # declarative dots + home-manager = { + url = "github:nix-community/home-manager/release-23.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # window manager (ricer friendly) + hyprland = { + url = "github:hyprwm/Hyprland"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; - outputs = - { nixpkgs - , nixpkgs-unstable - , home-manager - , nixos-hardware - # , apoth-admin - , ... - }: + outputs = { + nixpkgs, + nixpkgs-unstable, + home-manager, + hyprland, + nixos-hardware, + ... }: let system = "x86_64-linux"; overlay-unstable = final: prev: { @@ -54,7 +67,7 @@ modules = [ ./hosts/proserpina/configuration.nix # Load muir main nix config # nixos-hardware.nixosModules.$MODEL - ] ++ home-manager-config (import ./hosts/proserpina/home.nix) ++ common-modules; + ] ++ home-manager-config (import ./home/home.nix) ++ common-modules; }; }; }; diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..6549b63 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,7 @@ +{ + + import = [ + ./home.nix + ]; + +} diff --git a/home/desktop/default.nix b/home/desktop/default.nix new file mode 100644 index 0000000..18e2a45 --- /dev/null +++ b/home/desktop/default.nix @@ -0,0 +1,17 @@ +{ + + imports = [ + ./hyprland + # ./dunst + # ./fish + ./git + ./hyprland + ./kitty + # ./micro + # ./rofi + # ./starship + # ./stylix + ./waybar + ]; + +} diff --git a/home/desktop/git/default.nix b/home/desktop/git/default.nix new file mode 100644 index 0000000..09dec81 --- /dev/null +++ b/home/desktop/git/default.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + + programs.git = { + enable = true; + + userName = "serenity-F"; + userEmail = "serenity-amalgam@protonmail.com"; + + extraConfig = { + init.defaultBranch = "main"; + }; + }; + + home.packages = [ + pkgs.gh + pkgs.git-lfs + ]; + +} diff --git a/home/desktop/hyprland/default.nix b/home/desktop/hyprland/default.nix new file mode 100644 index 0000000..36cd6c2 --- /dev/null +++ b/home/desktop/hyprland/default.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, osConfig, ... } + +{ + + imports = [ + hyprland.homeManagerModules.default + ./hyprland-environment.nix + + ]; + + home = { + packages = with pkgs; [ + waybar + ]; + }; + + wayland.windowManager.hyprland = { + enable = true; + systemdIntegration = true; + settings = { + "$mod" = "SUPER"; + bind = [ + "$mod, F, exec, firefox" + ", Print, exec, grimblast copy area" + ] ++ ( # workspaces + # binds $mod + [shift+] {1..10} to [move to] workspace {1..10} + builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 10) + ); + }; + }; + + home.stateVersion = "23.11"; + +} diff --git a/home/desktop/hyprland/environment.nix b/home/desktop/hyprland/environment.nix new file mode 100644 index 0000000..710ff45 --- /dev/null +++ b/home/desktop/hyprland/environment.nix @@ -0,0 +1,20 @@ +{ config, pkgs, ... }: + +{ + + home = { + + sessionVariables = { + EDITOR = "micro"; + BROWSER = "firefox"; + TERMINAL = "kitty"; + + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_DESKTOP - "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + + }; + + }; + +} diff --git a/home/desktop/kitty/default.nix b/home/desktop/kitty/default.nix new file mode 100644 index 0000000..bf458aa --- /dev/null +++ b/home/desktop/kitty/default.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: + +{ + + programs.kitty = { + enable = true; + + # theme = "insert-theme" + + # font = { + # name = "insert-font" + # size = 12 + # }; + + settings ={ + confirm_os_window_close = 0; + background_opacity = "0.55"; + window_padding_width = 10; + scrollback_lines = 10000; + enable_audio_bell = false; + mouse_hide_wait = 60; + tab_title_template = "{index}"; + active_tab_font_style = "normal"; + inactive_tab_font_style = "normal"; + tab_bar_style = "powerline"; + tab_powerline_style = "round"; + active_tab_foreground = "#1e1e2e"; + active_tab_background = "#cba6f7"; + inactive_tab_foreground = "#bac2de"; + inactive_tab_background = "#313244"; + }; + + keybindings = { + + }; + + }; + +} diff --git a/home.nix b/home/home.nix similarity index 83% rename from home.nix rename to home/home.nix index e999308..a01bc46 100755 --- a/home.nix +++ b/home/home.nix @@ -2,8 +2,9 @@ { imports = [ - # ./users.nix - ./modules/hyprland.nix + ./users + ./desktop + ]; programs.home-manager.enable = true; @@ -16,15 +17,25 @@ # Installing muir packages uvu home.packages = with pkgs; [ + # - Multimedia - gimp spotify + # nicotine-plus # jellyfin-media-player + # gimp + # krita + # inkscape + # obs + # ardour + # - Web & Chat + # fractal schildichat-desktop + # - Coding # vscodium # gitui + ]; diff --git a/home/users/default.nix b/home/users/default.nix new file mode 100644 index 0000000..b1b9351 --- /dev/null +++ b/home/users/default.nix @@ -0,0 +1,7 @@ +{ + + import = [ + ./serenity.nix + ]; + +} diff --git a/home/users/serenity.nix b/home/users/serenity.nix new file mode 100644 index 0000000..997b99f --- /dev/null +++ b/home/users/serenity.nix @@ -0,0 +1 @@ +# EMPTY FOR NOW diff --git a/hosts/hades/configuration.nix b/hosts/hades/configuration.nix new file mode 100644 index 0000000..0c6c632 --- /dev/null +++ b/hosts/hades/configuration.nix @@ -0,0 +1,103 @@ +{ inputs, outputs, config, pkgs, lib, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" + ./disko-config.nix + ./hardware-configuration.nix + ../../configuration.nix + ]; + + # Enable swap on luks + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + }; + 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 "performance"; + + hardware = { + + cpu.intel.updateMicrocode = true; + enableAllFirmware = false; + bluetooth.enable = false; + + 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 7d"; + persistent = true; + }; + }; + + networking = { + hostName = "hades"; # Define your hostname + }; + + services = { + + syncthing = { + enable = false; + dataDir = "/home/serenity/"; + configDir = "/home/serenity/.config/syncthing"; + user = "serenity"; + settings = { + + devices = { + # hades.id = "$DEVICE_ID"; + # hecate.id = "$DEVICE_ID"; + # proserpina.id = "$DEVICE_ID"; + }; + + folders = { + # "$FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" ]; + # }; + + }; + }; + }; + }; + +} diff --git a/hosts/hades/disko-config.nix b/hosts/hades/disko-config.nix new file mode 100644 index 0000000..ecc32ac --- /dev/null +++ b/hosts/hades/disko-config.nix @@ -0,0 +1,59 @@ +{ + 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..47a61f8 --- /dev/null +++ b/hosts/hades/hardware-configuration.nix @@ -0,0 +1,26 @@ +# 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" ]; + 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/null.nix b/hosts/hades/null.nix deleted file mode 100644 index e69de29..0000000 diff --git a/hosts/proserpina/configuration.nix b/hosts/proserpina/configuration.nix index a608ffe..d86b5d1 100644 --- a/hosts/proserpina/configuration.nix +++ b/hosts/proserpina/configuration.nix @@ -77,7 +77,7 @@ services = { syncthing = { - enable = true; + enable = false; dataDir = "/home/serenity/"; configDir = "/home/serenity/.config/syncthing"; user = "serenity"; diff --git a/hosts/proserpina/home.nix b/hosts/proserpina/home.nix deleted file mode 100644 index dca63aa..0000000 --- a/hosts/proserpina/home.nix +++ /dev/null @@ -1,14 +0,0 @@ -let - gnomeProfile = import ../../desktops/gnome/profiles/gnome-profile.nix; -in -{ - imports = [ - ../../home.nix - ]; - dconf.settings = { - "org/gnome/shell" = { - enabled-extensions = gnomeProfile.extensions.laptop; - # favorite-apps = gnomeProfile.pinnedApps.laptop; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..8c2ea07 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,9 @@ +{ + + imports = [ + ./services + ./packages + ./network + ]; + +} diff --git a/modules/hyperland.nix b/modules/hyperland.nix deleted file mode 100644 index 018218d..0000000 --- a/modules/hyperland.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, lib, osConfig, ... } - -{ - - wayland.windowManager.hyprland = { - enable = true; - settings = { - "$mod" = "SUPER"; - bind = - [ - "$mod, F, exec, firefox" - ", Print, exec, grimblast copy area" - ] - ++ ( - # workspaces - # binds $mod + [shift+] {1..10} to [move to] workspace {1..10} - builtins.concatLists (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in [ - "$mod, ${ws}, workspace, ${toString (x + 1)}" - "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" - ] - ) - 10) - ); - }; - }; - - -} diff --git a/modules/network/default.nix b/modules/network/default.nix new file mode 100644 index 0000000..532a0d0 --- /dev/null +++ b/modules/network/default.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + import = [ + # + ]; + + # INSERT NETWORKING CONFIG HERE + +} diff --git a/modules/packages/default.nix b/modules/packages/default.nix new file mode 100644 index 0000000..429d163 --- /dev/null +++ b/modules/packages/default.nix @@ -0,0 +1,7 @@ +{ + + imports = [ + # ./file.nix + ]; + +} diff --git a/modules/services/default.nix b/modules/services/default.nix new file mode 100644 index 0000000..0662e51 --- /dev/null +++ b/modules/services/default.nix @@ -0,0 +1,7 @@ +{ + + imports = [ + # file.nix + ]; + +}