From 6faed86ea6e5518ff186ca1ec4104d5eefe21091 Mon Sep 17 00:00:00 2001 From: sils Date: Sun, 4 Dec 2022 18:20:29 +0100 Subject: Modularize config --- .gitignore | 1 + Readme.md | 22 ++++++++++ bootloader.nix | 6 +++ config.nix | 14 ++++++ configuration.nix | 128 ------------------------------------------------------ cups.nix | 5 +++ gnome.nix | 9 ++++ networking.nix | 15 +++++++ packages.nix | 22 ++++++++++ sound.nix | 6 +++ users.nix | 11 +++++ 11 files changed, 111 insertions(+), 128 deletions(-) create mode 100644 .gitignore create mode 100644 Readme.md create mode 100644 bootloader.nix create mode 100644 config.nix delete mode 100644 configuration.nix create mode 100644 cups.nix create mode 100644 gnome.nix create mode 100644 networking.nix create mode 100644 packages.nix create mode 100644 sound.nix create mode 100644 users.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..3abc877 --- /dev/null +++ b/Readme.md @@ -0,0 +1,22 @@ +# Configuration Files for NixOS + +This is my system configuration, targeting workstations. +It's intended to be private while not containing sensitive information. + + +To use, clone Repository in `/etc/nix-config` and put the following in +`/etc/nixos/configuration.nix`: +```nix +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + /etc/nix-config/config.nix + ]; + + system.stateVersion = ""; + +} +``` diff --git a/bootloader.nix b/bootloader.nix new file mode 100644 index 0000000..89395d2 --- /dev/null +++ b/bootloader.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/config.nix b/config.nix new file mode 100644 index 0000000..d2f7bd1 --- /dev/null +++ b/config.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./packages.nix + ./bootloader.nix + ./gnome.nix + ./networking.nix + ./users.nix + ./sound.nix + ./cups.nix + ]; +} diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 1b26088..0000000 --- a/configuration.nix +++ /dev/null @@ -1,128 +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 - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "thinklappi"; # 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 = "Europe/Amsterdam"; - - # 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 = "de"; - useXkbConfig = true; # use xkbOptions in tty. - }; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - - - # Configure keymap in X11 - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = { - # "eurosign:e"; - # "caps:escape" # map caps to escape. - # }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound. - sound.enable = true; - hardware.pulseaudio.enable = true; - - # 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.sils = { - isNormalUser = true;# - home = "/home/sils"; - shell = pkgs.zsh; - extraGroups = [ "wheel" "networkmanager"]; # Enable ‘sudo’ for the user. - # packages = with pkgs; [ - # firefox - # thunderbird - # ]; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - restic - thunderbird - firefox - zsh - element-desktop - libreoffice - keepassxc - gnome.gnome-terminal - lsd - jq - glow - git - signal-desktop - ]; - - # 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 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 = "23.05"; # Did you read the comment? - -} - diff --git a/cups.nix b/cups.nix new file mode 100644 index 0000000..1c1eea0 --- /dev/null +++ b/cups.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + services.printing.enable = true; +} diff --git a/gnome.nix b/gnome.nix new file mode 100644 index 0000000..505be78 --- /dev/null +++ b/gnome.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + services.xserver.enable = true; + + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + +} diff --git a/networking.nix b/networking.nix new file mode 100644 index 0000000..cbf204c --- /dev/null +++ b/networking.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +{ + networking.hostName = "thinklappi"; + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Berlin"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + #keyMap = "de"; + useXkbConfig = true; # use xkbOptions in tty. + }; +} diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..12373f8 --- /dev/null +++ b/packages.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + + environment.systemPackages = with pkgs; [ + neovim + wget + restic + thunderbird + firefox + zsh + element-desktop + libreoffice + keepassxc + gnome.gnome-terminal + lsd + jq + glow + git + signal-desktop + ]; +} diff --git a/sound.nix b/sound.nix new file mode 100644 index 0000000..10c3916 --- /dev/null +++ b/sound.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ + sound.enable = true; + hardware.pulseaudio.enable = true; +} diff --git a/users.nix b/users.nix new file mode 100644 index 0000000..c99bbd4 --- /dev/null +++ b/users.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + users.users.sils = { + isNormalUser = true; + home = "/home/sils"; + shell = pkgs.zsh; + extraGroups = [ "wheel" "networkmanager"]; + }; + +} -- cgit 1.4.1