summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix44
-rw-r--r--home-manager/home.nix20
-rw-r--r--hosts/phosphophyllite/default.nix56
-rw-r--r--hosts/phosphophyllite/hardware-configuration.nix33
-rw-r--r--nixos/common.nix177
5 files changed, 302 insertions, 28 deletions
diff --git a/flake.nix b/flake.nix
index a0e0f9d..3f80238 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,25 +27,53 @@
outputs = {
self,
nixpkgs,
- lanzaboote,
home-manager,
ocnix,
opencode,
...
} @ inputs: let
+ mkHost = {
+ hostname,
+ system ? "x86_64-linux",
+ modules ? [],
+ }:
+ nixpkgs.lib.nixosSystem {
+ inherit system;
+ specialArgs = { inherit inputs opencode; };
+ modules =
+ [
+ {
+ networking.hostName = hostname;
+ nixpkgs.overlays = [ ocnix.overlays.default ];
+ }
+ ocnix.nixosModules.opencode
+ home-manager.nixosModules.home-manager
+ ./nixos/common.nix
+ {
+ home-manager.useGlobalPkgs = true;
+ home-manager.useUserPackages = true;
+ home-manager.extraSpecialArgs = { inherit inputs; };
+ home-manager.users.phos = import ./home-manager/home.nix;
+ }
+ ]
+ ++ modules;
+ };
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
- phosphophyllite = nixpkgs.lib.nixosSystem {
- specialArgs = { inherit inputs opencode; };
- # > Our main nixos configuration file <
+ phosphophyllite = mkHost {
+ hostname = "phosphophyllite";
modules = [
- { nixpkgs.overlays = [ ocnix.overlays.default ]; }
- ocnix.nixosModules.opencode
- ./nixos/configuration.nix
+ ./hosts/phosphophyllite
];
};
+
+ # Add your laptop here when ready.
+ # laptop-hostname = mkHost {
+ # hostname = "laptop-hostname";
+ # modules = [ ./hosts/laptop ];
+ # };
};
# Standalone home-manager configuration entrypoint
@@ -61,4 +89,4 @@
};
};
};
-} \ No newline at end of file
+}
diff --git a/home-manager/home.nix b/home-manager/home.nix
index 19eec34..504421b 100644
--- a/home-manager/home.nix
+++ b/home-manager/home.nix
@@ -16,26 +16,6 @@
# ./nvim.nix
];
- nixpkgs = {
- # You can add overlays here
- overlays = [
- # If you want 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 your nixpkgs instance
- config = {
- # Disable if you don't want unfree packages
- allowUnfree = true;
- };
- };
-
home = {
username = "phos";
homeDirectory = "/home/phos";
diff --git a/hosts/phosphophyllite/default.nix b/hosts/phosphophyllite/default.nix
new file mode 100644
index 0000000..0f1f9c1
--- /dev/null
+++ b/hosts/phosphophyllite/default.nix
@@ -0,0 +1,56 @@
+{...}: {
+ imports = [
+ ./hardware-configuration.nix
+ ];
+
+ services.xserver.videoDrivers = [ "nvidia" ];
+
+ hardware.nvidia = {
+ modesetting.enable = true;
+ powerManagement.enable = false;
+ powerManagement.finegrained = false;
+ open = false;
+ nvidiaSettings = true;
+ };
+
+ services.pipewire.wireplumber.extraConfig."10-rename-devices" = {
+ "monitor.alsa.rules" = [
+ {
+ matches = [
+ {
+ "node.name" = "alsa_output.pci-0000_0a_00.4.analog-stereo";
+ }
+ ];
+ actions = {
+ update-props = {
+ "node.description" = "Speakers";
+ };
+ };
+ }
+ {
+ matches = [
+ {
+ "node.name" = "alsa_output.pci-0000_08_00.1.hdmi-stereo";
+ }
+ ];
+ actions = {
+ update-props = {
+ "device.disabled" = true;
+ };
+ };
+ }
+ {
+ matches = [
+ {
+ "node.name" = "alsa_output.usb-HP__Inc_HyperX_Cloud_II_Core_Wireless-00";
+ }
+ ];
+ actions = {
+ update-props = {
+ "node.description" = "HyperX Cloud II";
+ };
+ };
+ }
+ ];
+ };
+}
diff --git a/hosts/phosphophyllite/hardware-configuration.nix b/hosts/phosphophyllite/hardware-configuration.nix
new file mode 100644
index 0000000..0ce8cdf
--- /dev/null
+++ b/hosts/phosphophyllite/hardware-configuration.nix
@@ -0,0 +1,33 @@
+# 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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-amd" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/95d04e16-97f5-4dda-bd99-eebcfece01f7";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/EE61-21CA";
+ fsType = "vfat";
+ options = [ "fmask=0077" "dmask=0077" ];
+ };
+
+ swapDevices =
+ [ { device = "/dev/disk/by-uuid/a0e6ef0c-6429-466c-964b-67b4656e8027"; }
+ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}
diff --git a/nixos/common.nix b/nixos/common.nix
new file mode 100644
index 0000000..1f99fd9
--- /dev/null
+++ b/nixos/common.nix
@@ -0,0 +1,177 @@
+{
+ inputs,
+ lib,
+ pkgs,
+ opencode,
+ ...
+}: {
+ imports = [
+ inputs.serpantinum.nixosModules.default
+ inputs.spicetify-nix.nixosModules.default
+ inputs.helium-flake.nixosModules.default
+ inputs.lanzaboote.nixosModules.lanzaboote
+ ];
+
+ nixpkgs = {
+ config = {
+ allowUnfree = true;
+ permittedInsecurePackages = [ "librewolf-152.0.2-1" "librewolf-unwrapped-152.0.2-1" ];
+ };
+ };
+
+ nix = {
+ settings = {
+ experimental-features = "nix-command flakes";
+ flake-registry = "";
+ };
+ channel.enable = false;
+ };
+
+ boot.loader.systemd-boot.enable = lib.mkForce false;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ boot.lanzaboote = {
+ enable = true;
+ pkiBundle = "/var/lib/sbctl";
+ };
+
+ programs.hyprland = {
+ enable = true;
+ xwayland.enable = true;
+ };
+
+ services.xserver.enable = true;
+ services.displayManager.gdm.enable = true;
+ services.desktopManager.gnome.enable = false;
+
+ networking.networkmanager.enable = true;
+
+ time.timeZone = "Europe/Bratislava";
+
+ i18n.defaultLocale = "en_US.UTF-8";
+ i18n.extraLocaleSettings = {
+ LC_ADDRESS = "sk_SK.UTF-8";
+ LC_IDENTIFICATION = "sk_SK.UTF-8";
+ LC_MEASUREMENT = "sk_SK.UTF-8";
+ LC_MONETARY = "sk_SK.UTF-8";
+ LC_NAME = "sk_SK.UTF-8";
+ LC_NUMERIC = "sk_SK.UTF-8";
+ LC_PAPER = "sk_SK.UTF-8";
+ LC_TELEPHONE = "sk_SK.UTF-8";
+ LC_TIME = "sk_SK.UTF-8";
+ };
+
+ services.xserver.xkb = {
+ layout = "us";
+ variant = "";
+ };
+
+ hardware.graphics = {
+ enable = true;
+ enable32Bit = true;
+ };
+
+ users.users.phos = {
+ isNormalUser = true;
+ extraGroups = [ "networkmanager" "wheel" ];
+ packages = with pkgs; [ ];
+ };
+
+ services.pipewire = {
+ enable = true;
+ alsa.enable = true;
+ alsa.support32Bit = true;
+ pulse.enable = true;
+ };
+
+ services.tailscale = {
+ enable = true;
+ useRoutingFeatures = "client";
+ };
+
+ fonts.packages = with pkgs; [
+ nerd-fonts.jetbrains-mono
+ ];
+
+ environment.systemPackages = with pkgs; [
+ sbctl
+ wget
+ foot
+ starship
+ fastfetch
+ git
+ neovim
+ qemu
+ firefox-bin
+ cliphist
+ easyeffects
+ vscodium
+ tmux
+ pulseaudio
+ inotify-tools
+ matugen
+ pipes
+ vesktop
+ claude-code
+ bibata-cursors
+ wl-clipboard
+ uv
+ adw-gtk3
+ papirus-icon-theme
+ papirus-folders
+ glib
+ cliphist
+ opencode
+ gamescope
+ godot_4-mono
+ inputs.serpantinum.packages.${pkgs.stdenv.hostPlatform.system}.default
+ (prismlauncher.override {
+ jdks = [
+ zulu8
+ zulu17
+ zulu21
+ ];
+ additionalPrograms = [ ffmpeg ];
+ })
+ ];
+
+ programs.direnv.enable = true;
+
+ programs.helium = {
+ enable = true;
+ flags = [ "--ozone-platform-hint=auto" ];
+ };
+
+ programs.thunar.enable = true;
+ services.flatpak.enable = true;
+
+ programs.ssh.startAgent = true;
+
+ programs.steam = {
+ enable = true;
+ gamescopeSession.enable = true;
+ };
+
+ programs.spicetify = let
+ spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
+ in {
+ enable = true;
+ theme = {
+ name = "Matugen";
+ src = ./spicetify-theme;
+ injectCss = true;
+ replaceColors = true;
+ overwriteAssets = false;
+ };
+ colorScheme = "Matugen";
+ enabledExtensions = with spicePkgs.extensions; [
+ adblock
+ shuffle
+ ];
+ };
+
+ programs.dconf.enable = true;
+ programs.serpantinum.enable = true;
+
+ system.stateVersion = "25.11";
+}