From ed9000aabe77e38c57aea4a3c3b7d54dc5c9034c Mon Sep 17 00:00:00 2001 From: crurak Date: Wed, 2 Aug 2023 22:04:22 +0200 Subject: [PATCH] reorganize ./modules --- modules/configuration.nix | 96 --------------------------------------- modules/default.nix | 8 +++- modules/locale.nix | 17 +++++++ modules/networking.nix | 5 ++ modules/nix.nix | 5 ++ modules/packages.nix | 6 +++ modules/system.nix | 3 ++ modules/timezone.nix | 3 ++ modules/user.nix | 8 ++++ 9 files changed, 54 insertions(+), 97 deletions(-) delete mode 100644 modules/configuration.nix create mode 100644 modules/locale.nix create mode 100644 modules/networking.nix create mode 100644 modules/nix.nix create mode 100644 modules/packages.nix create mode 100644 modules/system.nix create mode 100644 modules/timezone.nix create mode 100644 modules/user.nix diff --git a/modules/configuration.nix b/modules/configuration.nix deleted file mode 100644 index ce0f64f..0000000 --- a/modules/configuration.nix +++ /dev/null @@ -1,96 +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. - ]; - - networking.hostName = "nixos"; # 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/Berlin"; - - nix.settings = { - experimental-features = "nix-command flakes"; - }; - - # Select internationalisation properties. - i18n.defaultLocale = "de_DE.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - - # Configure keymap in X11 - services.xserver = { - layout = "de"; - xkbVariant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.stefan = { - isNormalUser = true; - description = "stefan"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; []; - }; - - # 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 - ]; - - # 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 = "23.05"; # Did you read the comment? - -} diff --git a/modules/default.nix b/modules/default.nix index 23be732..c7dfbd5 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +1,13 @@ { imports = [ ./boot.nix - ./configuration.nix ./home-manager.nix + ./locale.nix + ./networking.nix + ./nix.nix + ./packages.nix + ./system.nix + ./user.nix + ./timezone.nix ]; } diff --git a/modules/locale.nix b/modules/locale.nix new file mode 100644 index 0000000..bb14c0e --- /dev/null +++ b/modules/locale.nix @@ -0,0 +1,17 @@ +{ + i18n = { + defaultLocale = "de_DE.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + }; + console.keyMap = "de"; +} diff --git a/modules/networking.nix b/modules/networking.nix new file mode 100644 index 0000000..6e5ffd1 --- /dev/null +++ b/modules/networking.nix @@ -0,0 +1,5 @@ +{ + networking = { + hostName = "nixos"; + networkmanager.enable = true; +} diff --git a/modules/nix.nix b/modules/nix.nix new file mode 100644 index 0000000..eb048f5 --- /dev/null +++ b/modules/nix.nix @@ -0,0 +1,5 @@ +{ + nix.settings = { + experimental-features = "nix-command flakes"; + }; +} diff --git a/modules/packages.nix b/modules/packages.nix new file mode 100644 index 0000000..f55c87f --- /dev/null +++ b/modules/packages.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: { + environment.systemPackages = with pkgs; [ + git + tree + ]; +} diff --git a/modules/system.nix b/modules/system.nix new file mode 100644 index 0000000..5b542b9 --- /dev/null +++ b/modules/system.nix @@ -0,0 +1,3 @@ +{ + system.stateVersion = "23.05"; +} diff --git a/modules/timezone.nix b/modules/timezone.nix new file mode 100644 index 0000000..4278ac3 --- /dev/null +++ b/modules/timezone.nix @@ -0,0 +1,3 @@ +{ + time.timeZone = "Europe/Berlin"; +} diff --git a/modules/user.nix b/modules/user.nix new file mode 100644 index 0000000..16e471f --- /dev/null +++ b/modules/user.nix @@ -0,0 +1,8 @@ +{ + users.users.stefan = { + isNormalUser = true; + description = "stefan"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; +}