diff --git a/config/arachnide/configuration.nix b/config/arachnide/configuration.nix index 70a3dbc..9357865 100644 --- a/config/arachnide/configuration.nix +++ b/config/arachnide/configuration.nix @@ -4,15 +4,14 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + /var/src/modules/nixin.nix + /var/src/modules/users.nix ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # Set NIX_PATH to use nixpkgs deployed with krops - environment.variables.NIX_PATH = lib.mkForce "/var/src"; - networking = { hostName = "arachnide"; # Define your hostname. # Pick only one of the below networking options. @@ -47,17 +46,6 @@ }; }; - # 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 using networkmanager - # networking.networkmanager.enable = true; - - - # Set your time zone. time.timeZone = "Etc/UTC"; @@ -76,48 +64,12 @@ LC_TIME = "fr_FR.UTF-8"; }; - # Configure keymap in X11 - services.xserver.xkb = { - layout = "fr"; - variant = ""; - }; - # Configure console keymap console.keyMap = "fr"; - # Define user accounts. Don't forget to set a password with 'passwd'. - users.users.douzeb = { - isNormalUser = true; - description = "douze baie"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; []; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRG0CyeeMMrrjTTm/PHgRXD/I4lH/bBPBCGUiL+cBdq douzeb@tux-12" - ]; - }; - - users.users.mrflos = { - isNormalUser = true; - description = "mr flos"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; []; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBBM+2TwkopAQF7splTWjORQoxjcp67VhodwzvTMlL8g florian@florian-LinuxMint-MBP" - ]; - }; - - # Passwordless sudo for members of the wheel group - security.sudo.wheelNeedsPassword = false; - # Allow unfree packages nixpkgs.config.allowUnfree = true; - environment.shellAliases = { - tm = "tmux new -A -s shared" ; - ll = "ls -al"; - }; - - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ @@ -155,15 +107,6 @@ # List services that you want to enable: - # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.openssh.ports = [ 144 ]; - services.openssh.settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; "net.ipv6.conf.all.forwarding" = 1; diff --git a/modules/nixin.nix b/modules/nixin.nix index e69de29..4d0c6c3 100644 --- a/modules/nixin.nix +++ b/modules/nixin.nix @@ -0,0 +1,21 @@ +# Nixin common configuration for all servers +{ config, pkgs, lib, ... }: +{ + # Set NIX_PATH to use nixpkgs deployed with krops + environment.variables.NIX_PATH = lib.mkForce "/var/src"; + + environment.shellAliases = { + tm = "tmux new -A -s shared" ; + ll = "ls -al"; + }; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + services.openssh.ports = [ 144 ]; + services.openssh.settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + +} diff --git a/modules/users.nix b/modules/users.nix new file mode 100644 index 0000000..4b4223e --- /dev/null +++ b/modules/users.nix @@ -0,0 +1,27 @@ +# Admin users +{ config, pkgs, ... }: +{ + # Define user accounts. Don't forget to set a password with 'passwd'. + users.users.douzeb = { + isNormalUser = true; + description = "douze baie"; + extraGroups = [ "wheel" ]; + packages = with pkgs; []; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRG0CyeeMMrrjTTm/PHgRXD/I4lH/bBPBCGUiL+cBdq douzeb@tux-12" + ]; + }; + + users.users.mrflos = { + isNormalUser = true; + description = "mr flos"; + extraGroups = [ "wheel" ]; + packages = with pkgs; []; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBBM+2TwkopAQF7splTWjORQoxjcp67VhodwzvTMlL8g florian@florian-LinuxMint-MBP" + ]; + }; + + # Passwordless sudo for members of the wheel group + security.sudo.wheelNeedsPassword = false; +}