From c5a4e4c6680a8d495c24f2dd92c2a9c53998c86e Mon Sep 17 00:00:00 2001 From: nat Date: Mon, 16 Jun 2025 02:09:21 -0400 Subject: [PATCH] beginning of something great? --- configuration.nix | 137 +++++++++++++++++++++++++++++++++++++ flake.lock | 48 +++++++++++++ flake.nix | 33 +++++++++ hardware-configuration.nix | 40 +++++++++++ home.nix | 89 ++++++++++++++++++++++++ 5 files changed, 347 insertions(+) create mode 100644 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 hardware-configuration.nix create mode 100644 home.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..fcaf65a --- /dev/null +++ b/configuration.nix @@ -0,0 +1,137 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + boot.initrd.kernelModules = [ "cryptd" ]; + boot.initrd.luks.devices."cryptroot".device = "/dev/nvme0n1p2"; + + nix = { settings.experimental-features = [ "nix-command" "flakes" ]; }; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "spectre"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + time.timeZone = "America/Montreal"; + + # 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; + + home-manager.useGlobalPkgs = 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; + + hardware.graphics.enable = true; + + # Enable sound. + security.rtkit.enable = true; + services.pulseaudio.enable = false; + # OR + services.pipewire = { + enable = true; + pulse.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + }; + + hardware.bluetooth.enable = true; + services.blueman.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.nat = { + isNormalUser = true; + home = "/home/nat"; + extraGroups = [ "wheel" "networkmanager" ]; # Enable ‘sudo’ for the user. + }; + home-manager.users.nat = import ./home.nix; + + + # List packages installed in system profile. + # You can use https://search.nixos.org/ to find more packages (and options). + environment.systemPackages = with pkgs; [ + kakoune # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + git + gay + blahaj + ]; + + # 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 = "25.05"; # Did you read the comment? + +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..22d98e6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749779443, + "narHash": "sha256-r6YTIMprNCYcJcA4oZ0x1wPaHPPHUxb8CnyEeMkhGks=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "18f3a0d21c3739a242aafa17c04c5238bbab5a41", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5312b28 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + }; + + outputs = { + self, + nixpkgs, + home-manager, + }: + let system = "x86_64-linux"; in + { + + nixosConfigurations = { + "spectre" = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./configuration.nix + home-manager.nixosModules.home-manager + ]; + }; + }; + + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..7cf658b --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ff5bde7d-89a7-4258-b132-c21cba81048d"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/4dccfae7-8b41-4b02-92a7-e56db4d8b7e2"; } + ]; + + # 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.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..d17e719 --- /dev/null +++ b/home.nix @@ -0,0 +1,89 @@ +{ pkgs, config, ... }: + +let + mod = "Mod4"; +in { + + home.username = "nat"; + home.homeDirectory = "/home/nat"; + home.packages = with pkgs; [ + julia-mono + bitwarden + gimp + godot + inkscape + libreoffice + lmms + mumble + picard + prismlauncher + signal-desktop + vlc + xournalpp + ]; + + services.blueman-applet.enable = true; + services.copyq.enable = true; + services.remmina.enable = true; + programs.firefox.enable = true; + programs.thunderbird = { + enable = true; + profiles = { main = { isDefault = true; }; }; + }; + programs.bash.enable = true; + programs.obs-studio.enable = true; + + programs.kitty = { + enable = true; + font = { + name = "juliaMono"; + }; + }; + + + wayland.windowManager.sway = { + enable = true; + config = { + modifier = mod; + terminal = "kitty"; + + # Waybar + bars = [{ + command = "${pkgs.lib.getExe config.programs.waybar.package}"; + position = "top"; + fonts = config.wayland.windowManager.sway.config.fonts; + }]; + + menu = "${pkgs.lib.getExe config.programs.rofi.package} -modes \"drun,run\" -show-icons -show drun"; + }; + + }; + + # Waybar + programs.waybar = { + enable = true; + }; + + + programs.rofi = { + enable = true; + }; + + + home.sessionVariables = { + EDITOR = "kak"; + }; + + + qt = { + enable = true; + # style = {}; + }; + + gtk = { + enable = true; + # theme = {}; + }; + + home.stateVersion = "25.05"; +}