From fd4a6d32ac67a5ffde64bbceb696060de3c76c3c Mon Sep 17 00:00:00 2001 From: Alexandre LUCAZEAU Date: Thu, 26 May 2022 17:22:03 +0000 Subject: [PATCH] ADD services hosts --- hosts/services/common.nix | 13 +++++++ hosts/services/configuration.nix | 16 +++++++++ hosts/services/hardware-configuration.nix | 8 +++++ hosts/services/users.nix | 41 +++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 hosts/services/common.nix create mode 100644 hosts/services/configuration.nix create mode 100644 hosts/services/hardware-configuration.nix create mode 100644 hosts/services/users.nix diff --git a/hosts/services/common.nix b/hosts/services/common.nix new file mode 100644 index 0000000..fc6dfb3 --- /dev/null +++ b/hosts/services/common.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ...}: +{ + environment.variables.EDITOR = "nvim"; + environment.systemPackages = with pkgs; [ + gitAndTools.gitFull + unzip + zip + tmux + lshw + bc + neovim + ]; +} diff --git a/hosts/services/configuration.nix b/hosts/services/configuration.nix new file mode 100644 index 0000000..ef3d509 --- /dev/null +++ b/hosts/services/configuration.nix @@ -0,0 +1,16 @@ +{ ... }: { + imports = [ + ./hardware-configuration.nix + ../modules/users.nix + ../modules/common.nix + + ]; + + boot.cleanTmpDir = true; + zramSwap.enable = true; + networking.hostName = "services"; + services.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUA1RW6JwZasspAp8qmFRFnlV5WXjhLfStAAkM+KYLv lucazeau.alexandre@gmail.com" + ]; +} diff --git a/hosts/services/hardware-configuration.nix b/hosts/services/hardware-configuration.nix new file mode 100644 index 0000000..a08c213 --- /dev/null +++ b/hosts/services/hardware-configuration.nix @@ -0,0 +1,8 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; + +} diff --git a/hosts/services/users.nix b/hosts/services/users.nix new file mode 100644 index 0000000..80e35a7 --- /dev/null +++ b/hosts/services/users.nix @@ -0,0 +1,41 @@ +{ config, pkgs, ...}: +{ + users = { + groups = { + alexandre = {}; + }; + users = { + alexandre = { + isNormalUser = true; + createHome = true; + home = "/home/alexandre"; + description = "Alexandre LUCAZEAU"; + extraGroups = [ "wheel" ]; + group = "alexandre"; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUA1RW6JwZasspAp8qmFRFnlV5WXjhLfStAAkM+KYLv lucazeau.alexandre@gmail.com" ]; + }; + }; + }; + programs.git = { + enable = true; + config.user.email = "lucazeau.alexandre@gmail.com"; + config.user.name = "Alexandre LUCAZEAU"; + config.init.defaultBranch = "main"; + config.core.sshCommand = "ssh -i ~/.ssh/id_ed25519-perso"; + }; + programs.fish.enable = true; + programs.fish.shellAliases = { + ll = "ls -l"; + ls = "ls --color=tty"; + vi = "nvim"; + vim = "nvim"; + }; + security.sudo = { + enable = true; + execWheelOnly = true; + extraRules = [ + { users = [ "alexandre" ]; commands = [ { command = "ALL"; options = [ "NOPASSWD" ]; } ]; } + ]; + }; +}