From f00850f5d6f898134a0191bf09455e2eca1b7a34 Mon Sep 17 00:00:00 2001 From: xezo360hye Date: Sun, 4 Aug 2024 23:43:48 +0300 Subject: [PATCH] Added ./system/common.nix and optimized ./system/${hostname}.nix --- system/common.nix | 91 ++++++++++++++++++++++++++++++++++++++++++++ system/maidena.nix | 80 -------------------------------------- system/tokishiko.nix | 84 +--------------------------------------- 3 files changed, 92 insertions(+), 163 deletions(-) create mode 100644 system/common.nix diff --git a/system/common.nix b/system/common.nix new file mode 100644 index 0000000..443ecc1 --- /dev/null +++ b/system/common.nix @@ -0,0 +1,91 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: +let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; +in +{ + # Bootloader + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + + # Networking + networking.networkmanager.enable = true; + services.openssh.enable = true; + + + # l10n and i8n + time.timeZone = "Europe/Riga"; + i18n.defaultLocale = "en_US.UTF-8"; + + + # Editor + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; + + + # Nix + nixpkgs.config.allowUnfree = true; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + flake-registry = ""; + nix-path = config.nix.nixPath; + }; + + channel.enable = false; + registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; + + + # Users + users.mutableUsers = false; + users.users.andrey = { + isNormalUser = true; + initialHashedPassword = "$y$j9T$mGZT4otEkrc94e.Ile.P20$BoxfgxCiacs.tYoEp7S5AjcP.aMUBrsaCJYJkBot635"; + extraGroups = [ "wheel" "cdrom" "networkmanager" "audio" "dialout" ]; + }; + + security.sudo.execWheelOnly = true; + security.sudo.wheelNeedsPassword = false; + + + # Packages + environment.systemPackages = with pkgs; [ + alsa-utils + mpv + ]; + + + # Xorg + security.rtkit.enable = true; + services = { + xserver.enable = true; + + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + libinput.touchpad = { + naturalScrolling = true; + disableWhileTyping = false; + tappingDragLock = false; + }; + }; + + + # Something important + system.stateVersion = "24.05"; +} diff --git a/system/maidena.nix b/system/maidena.nix index 7da30b3..737a1e4 100644 --- a/system/maidena.nix +++ b/system/maidena.nix @@ -5,95 +5,15 @@ lib, ... }: -let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; -in { - # Bootloader - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - - - # Networking networking.hostName = "maidena"; - networking.networkmanager.enable = true; - services.openssh.enable = true; - - # l10n and i8n - time.timeZone = "Europe/Riga"; - i18n.defaultLocale = "en_US.UTF-8"; - - - # Editor - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - defaultEditor = true; - }; - - - # Nix - nixpkgs.config.allowUnfree = true; - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - flake-registry = ""; - nix-path = config.nix.nixPath; - }; - - channel.enable = false; - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; - }; - - - # Sound TODO - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - # Users - users.mutableUsers = false; - users.users.andrey = { - isNormalUser = true; - initialHashedPassword = "$y$j9T$mGZT4otEkrc94e.Ile.P20$BoxfgxCiacs.tYoEp7S5AjcP.aMUBrsaCJYJkBot635"; - extraGroups = [ "wheel" "cdrom" "networkmanager" "audio" "dialout" ]; - }; - - security.sudo.execWheelOnly = true; - security.sudo.wheelNeedsPassword = false; - - - # Packages - environment.systemPackages = with pkgs; [ - alsa-utils - mpv - ]; - - - # Xorg services = { - xserver.enable = true; desktopManager.plasma6.enable = true; displayManager.sddm = { enable = true; wayland.enable = true; }; - - libinput.touchpad = { - naturalScrolling = true; - disableWhileTyping = false; - tappingDragLock = false; - }; }; - - - # Something important - system.stateVersion = "24.05"; } # vim: ts=2 sw=2 et diff --git a/system/tokishiko.nix b/system/tokishiko.nix index 09be062..21a2250 100644 --- a/system/tokishiko.nix +++ b/system/tokishiko.nix @@ -5,102 +5,20 @@ lib, ... }: -let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; -in { - # Bootloader - boot.loader.grub.enable = true; - boot.loader.grub.device = "/dev/sda"; - - - # Networking networking.hostName = "tokishiko"; - networking.networkmanager.enable = true; - services.openssh.enable = true; + console.keyMap = "no"; - - # l10n and i8n - time.timeZone = "Europe/Riga"; - i18n.defaultLocale = "en_US.UTF-8"; - - console = { - keyMap = "no"; - }; - - - # Editor - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - defaultEditor = true; - }; - - - # Nix - nixpkgs.config.allowUnfree = true; - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - flake-registry = ""; - nix-path = config.nix.nixPath; - }; - - channel.enable = false; - registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; - }; - - - # Sound - hardware.pulseaudio.enable = true; - hardware.pulseaudio.support32Bit = true; - - - # Users - users.mutableUsers = false; - users.users.andrey = { - isNormalUser = true; - initialHashedPassword = "$y$j9T$mGZT4otEkrc94e.Ile.P20$BoxfgxCiacs.tYoEp7S5AjcP.aMUBrsaCJYJkBot635"; - extraGroups = [ "wheel" "cdrom" "networkmanager" "audio" "dialout" ]; - }; - - security.sudo.execWheelOnly = true; - security.sudo.wheelNeedsPassword = false; - - - # Packages - environment.systemPackages = with pkgs; [ - alsa-utils - mpv - ]; - - - # Xorg services = { xserver = { - enable = true; - windowManager.awesome.enable = true; - xkb.layout = "no(nodeadkeys)"; }; displayManager = { enable = true; - defaultSession = "none+awesome"; }; - - libinput.touchpad = { - naturalScrolling = true; - disableWhileTyping = false; - tappingDragLock = false; - }; }; - - - # Something important - system.stateVersion = "24.05"; } # vim: ts=2 sw=2 et