From 243a9339f041f62c1b5d8c05b415b126349c95b5 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 25 Apr 2023 23:10:57 +0300 Subject: reflopactor (#1) --- flake.lock | 30 ++---- flake.nix | 32 ++---- home-manager/home.nix | 73 -------------- homes/default.nix | 19 ++++ homes/floppydisk/default.nix | 47 +++++++++ hosts/default.nix | 23 +++++ hosts/nixbox/configuration.nix | 140 ++++++++++++++++++++++++++ hosts/nixbox/hardware-configuration.nix | 44 ++++++++ modules/home-manager/default.nix | 7 -- modules/nixos/default.nix | 7 -- modules/public/home-manager/default.nix | 6 ++ modules/public/nixos/default.nix | 6 ++ nixos/configuration.nix | 100 ------------------ nixos/hardware-configuration.nix | 10 -- nixos/hosts/nixbox/configuration.nix | 140 -------------------------- nixos/hosts/nixbox/hardware-configuration.nix | 40 -------- nixpkgs.nix | 11 +- overlays/default.nix | 24 ----- pkgs/default.nix | 3 +- shell.nix | 5 +- 20 files changed, 312 insertions(+), 455 deletions(-) delete mode 100644 home-manager/home.nix create mode 100644 homes/default.nix create mode 100644 homes/floppydisk/default.nix create mode 100644 hosts/default.nix create mode 100644 hosts/nixbox/configuration.nix create mode 100644 hosts/nixbox/hardware-configuration.nix delete mode 100644 modules/home-manager/default.nix delete mode 100644 modules/nixos/default.nix create mode 100644 modules/public/home-manager/default.nix create mode 100644 modules/public/nixos/default.nix delete mode 100644 nixos/configuration.nix delete mode 100644 nixos/hardware-configuration.nix delete mode 100644 nixos/hosts/nixbox/configuration.nix delete mode 100644 nixos/hosts/nixbox/hardware-configuration.nix delete mode 100644 overlays/default.nix diff --git a/flake.lock b/flake.lock index c0a392d..39e5152 100644 --- a/flake.lock +++ b/flake.lock @@ -4,15 +4,14 @@ "inputs": { "nixpkgs": [ "nixpkgs" - ], - "utils": "utils" + ] }, "locked": { - "lastModified": 1676892629, - "narHash": "sha256-rlvsqoSBO5dCwfnn7xvImYREidIPJaiFS3b54TZF4pU=", + "lastModified": 1682419509, + "narHash": "sha256-+/HI3RbJcEKQ5+55dECzh8geginsbabsA0R3ORKi2Us=", "owner": "nix-community", "repo": "home-manager", - "rev": "72ce74d3eae78a6b31538ea7ebe0c1fcf4a10f7a", + "rev": "6142193635ecdafb9a231bd7d1880b9b7b210d19", "type": "github" }, "original": { @@ -39,11 +38,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1676721149, - "narHash": "sha256-mN2EpTGxxVNnFZLoLWRwh6f7UWhXy4qE+wO2CZyrXps=", + "lastModified": 1682362401, + "narHash": "sha256-/UMUHtF2CyYNl4b60Z2y4wwTTdIWGKhj9H301EDcT9M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5f4e07deb7c44f27d498f8df9c5f34750acf52d2", + "rev": "884ac294018409e0d1adc0cae185439a44bd6b0b", "type": "github" }, "original": { @@ -59,21 +58,6 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } - }, - "utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 9329055..c9ba154 100644 --- a/flake.nix +++ b/flake.nix @@ -10,15 +10,13 @@ # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. # Home manager - home-manager.url = "github:nix-community/home-manager"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # TODO: Add any other flake you might need - # hardware.url = "github:nixos/nixos-hardware"; - - # Shameless plug: looking for a way to nixify your themes and make - # everything match nicely? Try nix-colors! - # nix-colors.url = "github:misterio77/nix-colors"; + # nixos-hardware.url = "github:nixos/nixos-hardware"; }; outputs = { @@ -54,26 +52,18 @@ ); # Your custom packages and modifications, exported as overlays - overlays = import ./overlays {inherit inputs;}; + # overlays = import ./overlays {inherit inputs;}; # TODO: only use overlays when you understand what tthey do + # Reusable nixos modules you might want to export # These are usually stuff you would upstream into nixpkgs - nixosModules = import ./modules/nixos; + # nixosModules = import ./modules/public/nixos; # Reusable home-manager modules you might want to export # These are usually stuff you would upstream into home-manager - homeManagerModules = import ./modules/home-manager; + # homeManagerModules = import ./modules/public/home-manager; # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' - nixosConfigurations = { - # FIXME replace with your hostname - nixbox = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; - modules = [ - # > Our main nixos configuration file < - ./nixos/hosts/nixbox/configuration.nix - ]; - }; - }; + nixosConfigurations = import ./hosts {inherit nixpkgs self outputs;}; # Standalone home-manager configuration entrypoint # Available through 'home-manager --flake .#your-username@your-hostname' @@ -83,7 +73,7 @@ extraSpecialArgs = {inherit inputs outputs;}; modules = [ # > Our main home-manager configuration file < - ./home-manager/home.nix + ./homes/floppydisk ]; }; }; diff --git a/home-manager/home.nix b/home-manager/home.nix deleted file mode 100644 index 46f555d..0000000 --- a/home-manager/home.nix +++ /dev/null @@ -1,73 +0,0 @@ -# This is your home-manager configuration file -# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - # You can import other home-manager modules here - imports = [ - # If you want to use modules your own flake exports (from modules/home-manager): - # outputs.homeManagerModules.example - - # Or modules exported from other flakes (such as nix-colors): - # inputs.nix-colors.homeManagerModules.default - - # You can also split up your configuration and import pieces of it here: - # ./nvim.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add 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; - # Workaround for https://github.com/nix-community/home-manager/issues/2942 - allowUnfreePredicate = _: true; - }; - }; - - home = { - username = "floppydisk"; - homeDirectory = "/home/floppydisk"; - }; - - # Add stuff for your user as you see fit: - programs.neovim.enable = true; - home.packages = with pkgs; [steam vscode _1password-gui _1password neofetch microsoft-edge webcord-vencord]; - - # Enable home-manager and git - programs.home-manager.enable = true; - - programs.git = { - enable = true; - userName = "Frankie B."; - userEmail = "git@diskfloppy.me"; - }; - - # Nicely reload system units when changing configs - systemd.user.startServices = "sd-switch"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - home.stateVersion = "22.11"; -} diff --git a/homes/default.nix b/homes/default.nix new file mode 100644 index 0000000..267a3d0 --- /dev/null +++ b/homes/default.nix @@ -0,0 +1,19 @@ +{ + inputs, + self, + outputs, + ... +}: { + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + extraSpecialArgs = { + inherit inputs self outputs; + }; + users = { + # TODO: "base" user that will be used by default is there is no defined + # home directory for the user + floppydisk = ./floppydisk; + }; + }; +} diff --git a/homes/floppydisk/default.nix b/homes/floppydisk/default.nix new file mode 100644 index 0000000..89363cc --- /dev/null +++ b/homes/floppydisk/default.nix @@ -0,0 +1,47 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + outputs, + pkgs, + ... +}: { + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # outputs.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + # ./nvim.nix + ]; + + home = { + username = "floppydisk"; + homeDirectory = "/home/floppydisk"; + packages = with pkgs; [steam vscode _1password-gui _1password neofetch microsoft-edge webcord-vencord]; + }; + + # Add stuff for your user as you see fit: + programs = { + # Enable neovim + neovim.enable = true; + + # Enable home-manager + home-manager.enable = true; + + # enable git and configure users + git = { + enable = true; + userName = "Frankie B."; + userEmail = "git@diskfloppy.me"; + }; + }; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "22.11"; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..36a8b85 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,23 @@ +{ + nixpkgs, + self, + outputs, + ... +}: let + inputs = self.inputs; + + home-manager = inputs.home-manager.nixosModules.home-manager; + homes = ../homes; +in { + nixbox = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + # this list defines which files will be imported to be used as "modules" in the system config + ./nixbox/configuration.nix + + # use the nixos-module for home-manager + home-manager + homes + ]; + }; +} diff --git a/hosts/nixbox/configuration.nix b/hosts/nixbox/configuration.nix new file mode 100644 index 0000000..9897d25 --- /dev/null +++ b/hosts/nixbox/configuration.nix @@ -0,0 +1,140 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + networking.hostName = "nixbox"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + # Enable experimental features + nix.settings.extra-experimental-features = ["flakes" "nix-command"]; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + services.xserver.videoDrivers = ["nvidia" "intel"]; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.floppydisk = { + isNormalUser = true; + description = "Frankie B."; + extraGroups = ["networkmanager" "wheel"]; + packages = with pkgs; [ + firefox + kate + # thunderbird + ]; + initialPassword = "changeme"; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + 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 + git + gnupg + pinentry + ]; + + # 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; + + # 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 = "22.11"; # Did you read the comment? +} diff --git a/hosts/nixbox/hardware-configuration.nix b/hosts/nixbox/hardware-configuration.nix new file mode 100644 index 0000000..2be489f --- /dev/null +++ b/hosts/nixbox/hardware-configuration.nix @@ -0,0 +1,44 @@ +# 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" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/c694a72f-2faa-49f3-813f-b9b552143088"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = { + device = "/dev/disk/by-uuid/BA8E-DAAA"; + fsType = "vfat"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f30ab1ac-66a5-4389-b4fe-a52f53255ec6";} + ]; + + # 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.enp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100644 index e41f7d9..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. - -{ - # List your module files here - # my-module = import ./my-module.nix; -} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix deleted file mode 100644 index bec6184..0000000 --- a/modules/nixos/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). -# These should be stuff you would like to share with others, not your personal configurations. - -{ - # List your module files here - # my-module = import ./my-module.nix; -} diff --git a/modules/public/home-manager/default.nix b/modules/public/home-manager/default.nix new file mode 100644 index 0000000..45aae31 --- /dev/null +++ b/modules/public/home-manager/default.nix @@ -0,0 +1,6 @@ +# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/public/nixos/default.nix b/modules/public/nixos/default.nix new file mode 100644 index 0000000..8605069 --- /dev/null +++ b/modules/public/nixos/default.nix @@ -0,0 +1,6 @@ +# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix deleted file mode 100644 index 265a010..0000000 --- a/nixos/configuration.nix +++ /dev/null @@ -1,100 +0,0 @@ -# This is your system's configuration file. -# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) - -{ inputs, outputs, lib, config, pkgs, ... }: { - # You can import other NixOS modules here - imports = [ - # If you want to use modules your own flake exports (from modules/nixos): - # outputs.nixosModules.example - - # Or modules from other flakes (such as nixos-hardware): - # inputs.hardware.nixosModules.common-cpu-amd - # inputs.hardware.nixosModules.common-ssd - - # You can also split up your configuration and import pieces of it here: - # ./users.nix - - # Import your generated (nixos-generate-config) hardware configuration - ./hardware-configuration.nix - ]; - - nixpkgs = { - # You can add overlays here - overlays = [ - # Add overlays your own flake exports (from overlays and pkgs dir): - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - - # You can also add 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; - }; - }; - - nix = { - # This will add each flake input as a registry - # To make nix3 commands consistent with your flake - registry = lib.mapAttrs (_: value: { flake = value; }) inputs; - - # This will additionally add your inputs to the system's legacy channels - # Making legacy nix commands consistent as well, awesome! - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - - settings = { - # Enable flakes and new 'nix' command - experimental-features = "nix-command flakes"; - # Deduplicate and optimize nix store - auto-optimise-store = true; - }; - }; - - # FIXME: Add the rest of your current configuration - - # TODO: Set your hostname - networking.hostName = "your-hostname"; - - # TODO: This is just an example, be sure to use whatever bootloader you prefer - boot.loader.systemd-boot.enable = true; - - # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. - users.users = { - # FIXME: Replace with your username - your-username = { - # TODO: You can set an initial password for your user. - # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. - # Be sure to change it (using passwd) after rebooting! - initialPassword = "correcthorsebatterystaple"; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect - ]; - # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) - extraGroups = [ "wheel" ]; - }; - }; - - # This setups a SSH server. Very important if you're setting up a headless system. - # Feel free to remove if you don't need it. - services.openssh = { - enable = true; - # Forbid root login through SSH. - permitRootLogin = "no"; - # Use keys only. Remove if you want to SSH using password (not recommended) - passwordAuthentication = false; - }; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "22.11"; -} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix deleted file mode 100644 index dd00939..0000000 --- a/nixos/hardware-configuration.nix +++ /dev/null @@ -1,10 +0,0 @@ -# This is just an example, you should generate yours with nixos-generate-config and put it in here. -{ - fileSystems."/" = { - device = "/dev/sda1"; - fsType = "ext4"; - }; - - # Set your system kind (needed for flakes) - nixpkgs.hostPlatform = "x86_64-linux"; -} diff --git a/nixos/hosts/nixbox/configuration.nix b/nixos/hosts/nixbox/configuration.nix deleted file mode 100644 index 9897d25..0000000 --- a/nixos/hosts/nixbox/configuration.nix +++ /dev/null @@ -1,140 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ - config, - pkgs, - ... -}: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; - - networking.hostName = "nixbox"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "Europe/London"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_GB.UTF-8"; - LC_IDENTIFICATION = "en_GB.UTF-8"; - LC_MEASUREMENT = "en_GB.UTF-8"; - LC_MONETARY = "en_GB.UTF-8"; - LC_NAME = "en_GB.UTF-8"; - LC_NUMERIC = "en_GB.UTF-8"; - LC_PAPER = "en_GB.UTF-8"; - LC_TELEPHONE = "en_GB.UTF-8"; - LC_TIME = "en_GB.UTF-8"; - }; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the KDE Plasma Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - - # Configure keymap in X11 - services.xserver = { - layout = "us"; - xkbVariant = ""; - }; - - # Enable experimental features - nix.settings.extra-experimental-features = ["flakes" "nix-command"]; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - services.xserver.videoDrivers = ["nvidia" "intel"]; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.floppydisk = { - isNormalUser = true; - description = "Frankie B."; - extraGroups = ["networkmanager" "wheel"]; - packages = with pkgs; [ - firefox - kate - # thunderbird - ]; - initialPassword = "changeme"; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - 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 - git - gnupg - pinentry - ]; - - # 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; - - # 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 = "22.11"; # Did you read the comment? -} diff --git a/nixos/hosts/nixbox/hardware-configuration.nix b/nixos/hosts/nixbox/hardware-configuration.nix deleted file mode 100644 index f59433a..0000000 --- a/nixos/hosts/nixbox/hardware-configuration.nix +++ /dev/null @@ -1,40 +0,0 @@ -# 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" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/c694a72f-2faa-49f3-813f-b9b552143088"; - fsType = "ext4"; - }; - - fileSystems."/boot/efi" = - { device = "/dev/disk/by-uuid/BA8E-DAAA"; - fsType = "vfat"; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/f30ab1ac-66a5-4389-b4fe-a52f53255ec6"; } - ]; - - # 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.enp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/nixpkgs.nix b/nixpkgs.nix index 041de40..e4d0588 100644 --- a/nixpkgs.nix +++ b/nixpkgs.nix @@ -1,8 +1,9 @@ # A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file # This is useful to avoid using channels when using legacy nix commands -let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; +let + lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; in -import (fetchTarball { - url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; - sha256 = lock.narHash; -}) + import (fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; + }) diff --git a/overlays/default.nix b/overlays/default.nix deleted file mode 100644 index 9a03471..0000000 --- a/overlays/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -# This file defines overlays -{ inputs, ... }: -{ - # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs { pkgs = final; }; - - # This one contains whatever you want to overlay - # You can change versions, add patches, set compilation flags, anything really. - # https://nixos.wiki/wiki/Overlays - modifications = final: prev: { - # example = prev.example.overrideAttrs (oldAttrs: rec { - # ... - # }); - }; - - # When applied, the unstable nixpkgs set (declared in the flake inputs) will - # be accessible through 'pkgs.unstable' - unstable-packages = final: _prev: { - unstable = import inputs.nixpkgs-unstable { - system = final.system; - config.allowUnfree = true; - }; - }; -} diff --git a/pkgs/default.nix b/pkgs/default.nix index 8c5e910..7403a05 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,6 +1,5 @@ # Custom packages, that can be defined similarly to ones from nixpkgs # You can build them using 'nix build .#example' or (legacy) 'nix-build -A example' - -{ pkgs ? (import ../nixpkgs.nix) { } }: { +{pkgs ? (import ../nixpkgs.nix) {}}: { # example = pkgs.callPackage ./example { }; } diff --git a/shell.nix b/shell.nix index 9525915..5982048 100644 --- a/shell.nix +++ b/shell.nix @@ -1,10 +1,9 @@ # Shell for bootstrapping flake-enabled nix and home-manager # You can enter it through 'nix develop' or (legacy) 'nix-shell' - -{ pkgs ? (import ./nixpkgs.nix) { } }: { +{pkgs ? (import ./nixpkgs.nix) {}}: { default = pkgs.mkShell { # Enable experimental features without having to specify the argument NIX_CONFIG = "experimental-features = nix-command flakes"; - nativeBuildInputs = with pkgs; [ nix home-manager git ]; + nativeBuildInputs = with pkgs; [nix home-manager git]; }; } -- cgit v1.2.3-54-g00ecf