diff options
author | Alex Auvolat <alex@adnab.me> | 2023-04-03 12:33:21 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-04-03 12:33:21 +0200 |
commit | 9ca1411a38925cb0534020a1efbc4ea57eec5cfe (patch) | |
tree | 5b9629bbed771c0c1727e26d465257f045b5c738 /rootless-nixos | |
parent | e7b19b1a5df73b1598bd8d8381aca74df3900e53 (diff) | |
download | user-config-9ca1411a38925cb0534020a1efbc4ea57eec5cfe.tar.gz user-config-9ca1411a38925cb0534020a1efbc4ea57eec5cfe.zip |
Test rootless nixos config
Diffstat (limited to 'rootless-nixos')
-rw-r--r-- | rootless-nixos/Makefile | 2 | ||||
-rw-r--r-- | rootless-nixos/configuration.nix | 157 | ||||
-rw-r--r-- | rootless-nixos/ssh_config | 3 |
3 files changed, 162 insertions, 0 deletions
diff --git a/rootless-nixos/Makefile b/rootless-nixos/Makefile new file mode 100644 index 0000000..eb96d6f --- /dev/null +++ b/rootless-nixos/Makefile @@ -0,0 +1,2 @@ +all: + sudo nixos-rebuild switch -I nixos-config=configuration.nix diff --git a/rootless-nixos/configuration.nix b/rootless-nixos/configuration.nix new file mode 100644 index 0000000..a8fcf9c --- /dev/null +++ b/rootless-nixos/configuration.nix @@ -0,0 +1,157 @@ +# 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, lib, ... }: + +let + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/refs/heads/release-22.11.tar.gz"; +in + +{ + imports = [ + (import "${home-manager}/nixos") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "nodev"; + #boot.loader.grub.extraGrubInstallArgs = [ "--bootloader-id=NixOS" ]; + boot.loader.efi.efiSysMountPoint = "/dev/efi"; + boot.loader.efi.canTouchEfiVariables = true; + + fileSystems."/" = + { device = "tmpfs"; + fsType = "tmpfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/c4cac70a-3179-4063-9865-65cc1a6314c6"; + fsType = "ext4"; + }; + + fileSystems."/boot/efi" = + { device = "/dev/disk/by-uuid/ADB6-2084"; + fsType = "vfat"; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/81ddfb59-2f8d-4a49-8ed2-1ca2dbf08d0d"; + fsType = "ext4"; + }; + + fileSystems."/data" = + { device = "/dev/disk/by-uuid/c696ab13-8d36-4ed6-b965-eba15c3b28f4"; + + fsType = "ext4"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + networking.hostName = "nixos"; # 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. + + time.timeZone = "Europe/Paris"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "sun12x22"; + keyMap = "fr"; + # useXkbConfig = true; # use xkbOptions in tty. + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the GNOME Desktop Environment. + services.xserver.displayManager.sx.enable = true; + services.xserver.windowManager.icewm.enable = true; + + + # Configure keymap in X11 + services.xserver.layout = "fr"; + services.xserver.xkbOptions = "eurosign:e,caps: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.lx = { + uid = 1000; + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + hashedPassword = "$y$j9T$MYbKJrmirtHLq3yd9V9jr1$UDcCp29ovu3waapi6229..k2b1qnkeLMfWe0Jwx1b64"; + }; + users.users.root.hashedPassword = "$y$j9T$5rD5qq5OkV3ap8Z3ZQKqO/$QzyG/NnbqX29QTKVaGgRhiVYu3kzU.jaGzNIPSYKjQ8"; + users.mutableUsers = false; + + home-manager.users.lx = { + home.file = { + ".ssh/config".source = ./ssh_config; + ".config/tmux/tmux.conf".source = ../tmux/tmux.conf; + ".vim/swp/emptydir".text = ""; + ".vim/backup/emptydir".text = ""; + ".config/sx/sxrc" = { + text = "${pkgs.icewm}/bin/icewm-session"; + executable = true; + }; + ".config/icewm/preferences".text = '' + TerminalCommand="st" + ''; + ".config/icewm/keys".text = '' + key "Super+Enter" st + ''; + }; + programs.vim = { + enable = true; + extraConfig = (builtins.readFile ../vim/vimrc); + plugins = with pkgs.vimPlugins; [ vim-nix fzf-vim nerdtree vim-go ]; + }; + home.stateVersion = "22.11"; + }; + + environment.systemPackages = with pkgs; [ + # CLI + vim + wget + gnumake + htop + git + + # GUI + st + dillo + links2 + #netsurf + ]; + programs.vim.defaultEditor = true; + + # services.openssh.enable = true; + + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + + system.copySystemConfiguration = true; + + system.stateVersion = "22.11"; + +} + diff --git a/rootless-nixos/ssh_config b/rootless-nixos/ssh_config new file mode 100644 index 0000000..58bd4a3 --- /dev/null +++ b/rootless-nixos/ssh_config @@ -0,0 +1,3 @@ +Host adnab.me + User katchup + Port 2022 |