From 9fdd050b7cd13c5d96d81be025cb22b6549d03ad Mon Sep 17 00:00:00 2001 From: Serenity-F Date: Mon, 8 Apr 2024 23:50:29 +1000 Subject: [PATCH] changed: editing to bring in line with changes in hyprland branch --- README.md | 35 ++++------ core/configuration.nix | 102 +++++++++++++++++++++++++++ core/packages.nix | 107 +++++++++++++++++++++++++++++ core/users.nix | 72 +++++++++++++++++++ modules/core/audio.nix | 17 ----- modules/core/default.nix | 30 -------- modules/core/display.nix | 45 ------------ modules/core/packages/default.nix | 59 ---------------- modules/core/packages/packages.nix | 63 ----------------- modules/core/services.nix | 39 ----------- modules/core/user.nix | 25 ------- 11 files changed, 295 insertions(+), 299 deletions(-) create mode 100644 core/configuration.nix create mode 100644 core/packages.nix create mode 100644 core/users.nix delete mode 100644 modules/core/audio.nix delete mode 100644 modules/core/default.nix delete mode 100644 modules/core/display.nix delete mode 100644 modules/core/packages/default.nix delete mode 100644 modules/core/packages/packages.nix delete mode 100644 modules/core/services.nix delete mode 100644 modules/core/user.nix diff --git a/README.md b/README.md index 132a1f5..5811d16 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,7 @@ To Do: > in order of priority - - [X] build ultraminimal general config **branch** - - [ ] build hyprland **branch**, following above structure - - [ ] build minimal fallback gnome **branch**, following main structure - - [ ] create new branch, merge, etc, make default branch if: + - [X] build "core" branch for all variant flakes to build upon - [X] get flake to actually build - [ ] per host hardware configurations @@ -23,25 +20,21 @@ To Do: --- -Cursory flake structure [Heavily WIP] - ---- +WIP Flake Structure ``` . +├── README +├── core +│ ├── configuration +│ ├── packages +│ └── users +├── flake.lock ├── flake.nix -├── hosts -│ ├── hades [MISSING] -│ └── proserpina -└── modules - └── core - ├── audio - ├── default - ├── display - ├── home - ├── packages - └── services - +└── hosts + └── proserpina + ├── configuration + ├── disko-config + ├── hardware-configuration + └── network-configuration ``` - ---- diff --git a/core/configuration.nix b/core/configuration.nix new file mode 100644 index 0000000..53f4655 --- /dev/null +++ b/core/configuration.nix @@ -0,0 +1,102 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + imports = [ + + # home-manager + inputs.home-manager.nixosModules.home-manager + + # also split up configuration.nix and import pieces: + ./users.nix + ./packages.nix + + ]; + + security = { + rtkit.enable = true; + sudo.execWheelOnly = true; + }; + + time.timeZone = "Australia/Brisbane"; + i18n.defaultLocale = "en_GB.UTF-8"; + + nixpkgs = { + # add overlays here + overlays = [ + # to use overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # configure nixpkgs instance + config = { + allowUnfree = true; + permittedInsecurePackages = [ + ]; + }; + }; + + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nix.nixPath = ["/etc/nix/path"]; + environment.etc = + lib.mapAttrs' + (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) + config.nix.registry; + + nix.settings = { + cores = 0; + auto-optimise-store = true; + allowed-users = [ "@wheel" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; + }; + + sound.enable = true; + hardware.pulseaudio.enable = false; + services.pipewire = { + + enable = true; + jack.enable = true; + pulse.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + # lowLatency.enable = true; + }; + + # disable these cuz they cause problems + # see: https://github.com/NixOS/nixpkgs/issues/180175 + systemd.services = { + networkManager-wait-online.enable = lib.mkForce false; + systemd-networkd-wait-online.enable = lib.mkForce false; + }; + + + # system.autoUpgrade = { + # enable = true; + # channel = ""; + # }; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.11"; +} diff --git a/core/packages.nix b/core/packages.nix new file mode 100644 index 0000000..6f6e186 --- /dev/null +++ b/core/packages.nix @@ -0,0 +1,107 @@ +{ pkgs, ... }: + +{ + + programs = { + # hyprland.enable = true; + traceroute.enable = true; + starship.enable = true; + fish.enable = true; + git.enable = true; + + firefox.enable = true; + + }; + + environment.systemPackages = with pkgs; [ + + ## nixos + appimage-run + # nix-tree + # nix-init + # nix-index + # nixpkgs-review + # nix-output-monitor + + ## filsesystem + udiskie + ntfs3g + xfsprogs + + ## compositor + waybar + swww + + ## terminal + kitty + micro + pipes + cbonsai + hyfetch + cmatrix + peaclock + + ## tools + file + fd + bc + gcc + zip + tldr + wget + curl + unzip + gnupg + blueman + busybox + ripgrep + killall + usbutils + pciutils + xdg_utils + moreutils + libsecret + git-crypt + + ## web browsers + # tor-browser-bundle-bin + # lagrange + # firefox + + ## misc, libraries, maybe more, + # qt5-wayland + # qt6-wayland + glib + + ]; + + fonts = { + + packages = with pkgs; [ + spleen + terminus_font + terminus_font_ttf + (nerdfonts.override { fonts = ["NerdFontsSymbolsOnly"]; }) + ]; + + fontDir.enable = true; + + fontconfig = { + defaultFonts = { + + monospace = [ + "TerminusTTF" + ]; + serif = [ + "spleen-32x64" + ]; + sansSerif = [ + "spleen-32x64" + ]; + + }; + }; + + }; + +} diff --git a/core/users.nix b/core/users.nix new file mode 100644 index 0000000..be6fbd9 --- /dev/null +++ b/core/users.nix @@ -0,0 +1,72 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: + +{ + + imports = [ + inputs.home-manager.nixosModules.default + ]; + + + users.users = { + + # To add users, copy and adjust to needs. + + # coffee = { + # description = "Coffee Beans"; + # isNormalUser = true; + # initialPassword = "password"; + # shell = pkgs.fish; + # extraGroups = [ + # "wheel" + # "networkmanager" + # ]; + # }; + + serenity = { + description = "Serenity Amalgam"; + isNormalUser = true; + initialPassword = "password"; + shell = pkgs.fish; + extraGroups = [ + "wheel" + "networkmanager" + ]; + }; + + }; + + home-manager = { + extraSpecialArgs = { inherit inputs outputs; }; + useGlobalPkgs = true; + useUserPackages = true; + users = { + + # coffee = { + # imports = [ ../home/home.nix ]; + # home = { + # username = "coffee"; + # homeDirectory = "/home/coffee"; + # stateVersion = "23.11"; + # }; + # }; + + serenity = { + imports = [ ../home/home.nix ]; + home = { + username = "serenity"; + homeDirectory = "/home/serenity"; + stateVersion = "23.11"; + }; + }; + + }; + }; + +} diff --git a/modules/core/audio.nix b/modules/core/audio.nix deleted file mode 100644 index ba6ed67..0000000 --- a/modules/core/audio.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: - -{ - - sound.enable = true; - hardware.pulseaudio.enable = false; - services.pipewire = { - - enable = true; - jack.enable = true; - pulse.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - lowLatency.enable = true; - }; - -} diff --git a/modules/core/default.nix b/modules/core/default.nix deleted file mode 100644 index dfbb069..0000000 --- a/modules/core/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - - imports = [ - ./services.nix - ./display.nix - ./user.nix - ./packages - ]; - - - # Timezone & locale - time.timeZone = "Australia/Brisbane"; - i18n.defaultLocale = "en_GB.UTF-8"; - - # security, apparently - security = { - rtkit.enable = true; - sudo.execWheelOnly = true; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? - -} diff --git a/modules/core/display.nix b/modules/core/display.nix deleted file mode 100644 index 6683344..0000000 --- a/modules/core/display.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ inputs, pkgs, username, ... }: - -{ - - programs.hyprland = { - enable = true; - xwayland.enable = true; - }; - - xdg.portal = { - enable = true; - wlr.enable = true; - xdgOpenUsePortal = true; - extraPortals = [ - pkgs.xdg-desktop-portal-hyprland - pkgs.xdg-desktop-portal-gtk - ]; - }; - - services.xserver = { - enable = true; - layout = "us"; # what is the difference # - xkbVariant = ""; # between - xkb.layout = "us"; # these 2 lolwut # - displayManager.autoLogin = { - enable = true; - user = "serenity"; - }; - libinput = { - enable = true; - mouse = { - accelProfile = "flat"; - }; - }; - }; - - # apparently prevents getting stuck at shutdown - systemd.extraConfig = "DefaultTimeoutStopSec=10s"; - - # set up hardware video acceleration - # https://nixos.wiki/wiki/Accelerated_Video_Playback - - system.stateVersion = "23.11"; - -} diff --git a/modules/core/packages/default.nix b/modules/core/packages/default.nix deleted file mode 100644 index a618b2f..0000000 --- a/modules/core/packages/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{pkgs, config, inputs, ... }: - -{ - - imports = [ - ./packages.nix - ]; - - - nix = { - settings = { - cores = 0; - auto-optimise-store = true; - allowed-users = [ - "@wheel" - ]; - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - }; - - nixpkgs = { - overlays = [ - ]; - config = { - allowUnfree = true; - permittedInsecurePackages = [ - "schildichat-web-1.11.30-sc.2" - "electron-25.9.0" - ]; - }; - }; - - - qt.style = "adwaita-dark"; - - services.flatpak.enable = true; - - boot.binfmt.registrations.appimage = { - wrapInterpreterInShell = false; - interpreter = "${pkgs.appimage-run}/bin/appimage-run"; - recognitionType = "magic"; - offset = 0; - mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff''; - magicOrExtension = ''\x7fELF....AI\x02''; - }; - - - system = { - stateVersion = "23.11"; - # autoUpgrade = { - # enable = true; - # channel = "INSERT_CHANNEL"; - # }; - }; - -} diff --git a/modules/core/packages/packages.nix b/modules/core/packages/packages.nix deleted file mode 100644 index 139f30a..0000000 --- a/modules/core/packages/packages.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ pkgs, ... }: - -{ - - environment.systemPackages = with pkgs; [ - - ## nixos - appimage-run - # nix-tree - # nix-init - # nix-index - # nixpkgs-review - # nix-output-monitor - - ## filsesystem - udiskie - ntfs3g - xfsprogs - - ## terminal - kitty - micro - - ## cli tools - hyfetch - file - zip - unzip - gnupg - busybox - killall - usbutils - pciutils - moreutils - libsecret - git-crypt - - ## web browsers - # tor-browser-bundle-bin - # lagrange - # firefox - - ## misc, fonts, libraries, maybe more - (nerdfonts.override { fonts = ["NerdFontsSymbolsOnly"]; }) - # qt5-wayland - # qt6-wayland - glib - - ]; - - - programs = { - traceroute.enable = true; - starship.enable = true; - fish.enable = true; - git.enable = true; - - # firefox.enable = true; - - }; - - -} diff --git a/modules/core/services.nix b/modules/core/services.nix deleted file mode 100644 index abdfec8..0000000 --- a/modules/core/services.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ pkgs, lib, config, ... }: - -{ - - imports = [ - ]; - - - services = { - - gvfs.enable = true; - dbus.enable = true; - - avahi = { - enable = false; - nssmdns = false; - openFirewall = false; - }; - - locate = { - enable = false; - package = pkgs.plocate; - localuser = null; - }; - - }; - - - # disable these cuz they cause problems - # see: https://github.com/NixOS/nixpkgs/issues/180175 - systemd.services = { - networkManager-wait-online.enable = lib.mkForce false; - systemd-networkd-wait-online.enable = lib.mkForce false; - }; - - - system.stateVersion = "23.11"; - -} diff --git a/modules/core/user.nix b/modules/core/user.nix deleted file mode 100644 index c3b5562..0000000 --- a/modules/core/user.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, config, ... }: - -{ - - imports = [ - ]; - - users = { - defaultUserShell = pkgs.fish; - - users.serenity = { - description = "Serenity Amalgam"; - isNormalUser = true; - shell = pkgs.fish; - extraGroups = [ - "wheel" - "networkmanager" - ]; - }; - - }; - - system.stateVersion = "23.11"; - -}