From 24eeb5967c3663a4e4e57c27d81eaa6dfa444d8e Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Thu, 11 Jun 2026 08:28:49 -0500 Subject: [PATCH] initial omen config --- README.md | 4 + modules/features/niri.nix | 31 +++++ modules/features/noctalia.nix | 10 ++ modules/hosts/omen-nixos/configuration.nix | 128 +++++++++++++++++++++ modules/hosts/omen-nixos/default.nix | 7 ++ modules/hosts/omen-nixos/hardware.nix | 28 +++++ 6 files changed, 208 insertions(+) create mode 100644 modules/features/niri.nix create mode 100644 modules/features/noctalia.nix create mode 100644 modules/hosts/omen-nixos/configuration.nix create mode 100644 modules/hosts/omen-nixos/default.nix create mode 100644 modules/hosts/omen-nixos/hardware.nix diff --git a/README.md b/README.md index b569a47..0cc5dba 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ home-manager switch --flake .#desktop nix flake show --all-systems ``` +```shell +nix run nixpkgs#nh home switch -- --configuration john@john-pc-ubuntu . +``` + ## Layout - Everything under `./modules` gets auto-imported by `import-tree` diff --git a/modules/features/niri.nix b/modules/features/niri.nix new file mode 100644 index 0000000..c858e5b --- /dev/null +++ b/modules/features/niri.nix @@ -0,0 +1,31 @@ +{ self, inputs, ... }: { + flake.nixosModules.niri = { pkgs, lib, ... }: { + programs.niri = { + enable = true; + package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri; + }; + }; + + perSystem = { pkgs, lib, self', ... }: { + packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap { + inherit pkgs; + settings = { + spawn-at-startup = [ + (lib.getExe self'.packages.myNoctalia) + ]; + + xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite; + + input.keyboard.xkb.layout = "us,ua"; + + layout.gaps = 5; + + binds = { + "Mod+Return".spawn-sh = lib.getExe pkgs.kitty; + "Mod+Q".close-window = null; + "Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} ipc call launcher toggle"; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/features/noctalia.nix b/modules/features/noctalia.nix new file mode 100644 index 0000000..fc04d76 --- /dev/null +++ b/modules/features/noctalia.nix @@ -0,0 +1,10 @@ +{ self, inputs, ... }: { + perSystem = { pkgs, ... }: { + packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap { + inherit pkgs; # THIS PART IS VERY IMPORTAINT, I FORGOT IT IN THE VIDEO!!! + settings = + (builtins.fromJSON + (builtins.readFile ./noctalia.json)).settings; + }; + }; +} \ No newline at end of file diff --git a/modules/hosts/omen-nixos/configuration.nix b/modules/hosts/omen-nixos/configuration.nix new file mode 100644 index 0000000..588401d --- /dev/null +++ b/modules/hosts/omen-nixos/configuration.nix @@ -0,0 +1,128 @@ +{ self, inputs, ... }: { + + flake.nixosModules.omen = { pkgs, lib, ... }: { + # import any other modules from here + imports = [ + self.nixosModules.omenHardware + self.nixosModules.niri + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "nixos-omen"; # Define your hostname. + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Configure network connections interactively with nmcli or nmtui. + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "US/Central"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + + + + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # services.pulseaudio.enable = true; + # OR + # services.pipewire = { + # enable = true; + # pulse.enable = true; + # }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + # users.users.alice = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # tree + # ]; + # }; + + # programs.firefox.enable = true; + + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + micro + nh + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "26.05"; # Did you read the comment? + # ... + }; + +} \ No newline at end of file diff --git a/modules/hosts/omen-nixos/default.nix b/modules/hosts/omen-nixos/default.nix new file mode 100644 index 0000000..98b8cc8 --- /dev/null +++ b/modules/hosts/omen-nixos/default.nix @@ -0,0 +1,7 @@ +{ self, inputs, ... }: { + flake.nixosConfigurations.omen = inputs.nixpkgs.lib.nixosSystem { + modules = [ + self.nixosModules.omen + ]; + }; +} \ No newline at end of file diff --git a/modules/hosts/omen-nixos/hardware.nix b/modules/hosts/omen-nixos/hardware.nix new file mode 100644 index 0000000..3440e55 --- /dev/null +++ b/modules/hosts/omen-nixos/hardware.nix @@ -0,0 +1,28 @@ +{ self, inputs, ... }: { + flake.nixosModules.omenHardware = { 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/35f77d1a-346c-4c52-83b2-7d25e2ac9fe1"; + fsType = "ext4"; + }; + "/mnt/shared" = { + device = "/dev/disk/by-uuid/216e8dca-170d-4377-bf1a-69b574e1778c"; + fsType = "ext4"; + }; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} \ No newline at end of file