diff --git a/flake.lock b/flake.lock index e8024c0..58b66da 100644 --- a/flake.lock +++ b/flake.lock @@ -36,10 +36,31 @@ "type": "github" } }, + "noctalia": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765375284, + "narHash": "sha256-McMVhLcwdFA5DS8yVGbk4COlINRkLrN1UTAymY416xQ=", + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "rev": "a47559c1c6cdaafb12d0280e4f4e76db5767d39b", + "type": "github" + }, + "original": { + "owner": "noctalia-dev", + "repo": "noctalia-shell", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "noctalia": "noctalia" } } }, diff --git a/flake.nix b/flake.nix index fbdd0fa..77ec059 100644 --- a/flake.nix +++ b/flake.nix @@ -14,16 +14,23 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # noctalia shell + noctalia = { + url = "github:noctalia-dev/noctalia-shell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; - outputs = { self, nixpkgs, home-manager, ... }: + outputs = inputs@{ self, nixpkgs, home-manager, ... }: let lib = nixpkgs.lib; system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; in { - # nixos system config nixosConfigurations = { + + # default config default = nixpkgs.lib.nixosSystem { inherit system; modules = [ @@ -33,13 +40,32 @@ ./hosts/default/hardware-configuration.nix ]; }; - }; - # home-manager config - homeConfigurations = { - aaron = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ ./hosts/default/home.nix ]; + + # laptop neon + neon = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + }; + modules = [ + # import host specific configs + ./hosts/neon/configuration.nix + # import host specific hardware configs + ./hosts/neon/hardware-configuration.nix + # import noctalia shell configs + ./hosts/neon/noctalia.nix + ]; }; - }; + + }; + + ## home-manager config + #homeConfigurations = { + # aaron = home-manager.lib.homeManagerConfiguration { + # inherit pkgs; + # modules = [ ./hosts/default/home.nix ]; + # }; + #}; + }; } diff --git a/hosts/neon/configuration.nix b/hosts/neon/configuration.nix new file mode 100644 index 0000000..3de36bf --- /dev/null +++ b/hosts/neon/configuration.nix @@ -0,0 +1,132 @@ +# 0x29a nixos conifg + +{ pkgs, lib, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + # use flakes + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # configure bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # plymouth boot eye candy + boot.initrd.systemd.enable = true; + boot.plymouth.enable = true; + boot.plymouth.theme = "spinner"; + + # use latest kernel + boot.kernelPackages = pkgs.linuxPackages_latest; + + # networking + networking.hostName = "neon"; + networking.networkmanager.enable = true; + + # bluetooth + hardware.bluetooth.enable = true; + + # time zone. + time.timeZone = "Europe/Amsterdam"; + + # select internationalisation properties + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + console = { + font = "Lat2-Terminus16"; + keyMap = "de_CH-latin1"; + }; + + # window manager configs + programs.niri.enable = true; + programs.xwayland.enable = true; + services.displayManager.gdm = { + enable = true; + wayland = true; + }; + services.tuned.enable = true; + services.upower.enable = true; + + environment.pathsToLink = [ "/libexec" ]; + environment.variables.EDITOR = "vim"; + + # enable sound + services.pipewire = { + enable = true; + pulse.enable = true; + }; + + # define a user account + users.users.aaron = { + isNormalUser = true; + group = "users"; + extraGroups = [ "wheel" ]; + shell = pkgs.zsh; + packages = with pkgs; [ + tree + fastfetch + ]; + }; + + # browser + programs.firefox.enable = true; + + # zsh config + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + ohMyZsh = { + enable = true; + plugins = [ "git" "sudo" ]; + theme = "gentoo"; + }; + }; + + # system packages + environment.systemPackages = with pkgs; [ + efibootmgr + neovim + vim + git + alacritty + ghostty + kitty + gnupg + xwayland + xwayland-satellite + wget + ]; + + # Some programs need SUID wrappers + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + # enable the OpenSSH daemon + services.openssh.enable = true; + + # firewall configs + networking.firewall.allowedTCPPorts = [ 22 ]; + networking.firewall.allowedUDPPorts = [ ]; + + # install state version + system.stateVersion = "25.11"; # Don't change +} + diff --git a/hosts/neon/hardware-configuration.nix b/hosts/neon/hardware-configuration.nix new file mode 100644 index 0000000..31a19c1 --- /dev/null +++ b/hosts/neon/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ]; + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt"; + + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/nixroot"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/nixboot"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-label/nixhome"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-label/nixswap"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/neon/home.nix b/hosts/neon/home.nix new file mode 100644 index 0000000..c93b67a --- /dev/null +++ b/hosts/neon/home.nix @@ -0,0 +1,76 @@ +{ config, pkgs, ... }: + +{ + # user config + home.username = "aaron"; + home.homeDirectory = "/home/aaron"; + + # packages + home.packages = with pkgs; [ + fastfetch + zip + xz + unzip + p7zip + jq + mtr + iperf3 + dnsutils + ldns + socat + nmap + cowsay + file + which + tree + zstd + gnupg + btop + iotop + iftop + strace + ltrace + lsof + sysstat + lm_sensors + ethtool + pciutils + usbutils + ]; + + # configure git + programs.git.settings = { + enable = true; + userName = "aaron"; + userEmail = "aaron@0x29a.ch"; + }; + + programs.zsh = { + enable = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + oh-my-zsh = { + enable = true; + plugins = [ "git" "sudo" "python" "ansible" ]; + theme = "agnoster"; + }; + }; + + + ## deploy qtile config + #home.file."qtile-config" = { + # target = ".config/qtile/config.py"; + # source = "${inputs.qtile-config}/qtile_config/config.py"; + # force = true; + #}; + + home.sessionVariables = { + EDITOR = "vim"; + }; + + # enable home manager + programs.home-manager.enable = true; + + # don't change + home.stateVersion = "25.05"; +} diff --git a/hosts/neon/noctalia.nix b/hosts/neon/noctalia.nix new file mode 100644 index 0000000..68e863e --- /dev/null +++ b/hosts/neon/noctalia.nix @@ -0,0 +1,7 @@ +{ pkgs, inputs, ... }: +{ + # install noctalia package + environment.systemPackages = with pkgs; [ + inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; +}