summaryrefslogblamecommitdiff
path: root/rootless-nixos/configuration.nix
blob: 8b8eec77f4c59e94867305f069cbc0bb81518255 (plain) (tree)










































































































                                                                                                                               
                                           



                                                          



                                         





                                           
                                              








                                                                             
















                                                                          
        




          


                   













                                                  
# 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 = ''
          setxkbmap fr
          ${pkgs.icewm}/bin/icewm-session
        '';
        executable = true;
      };
      ".config/icewm/preferences".text = ''
        TerminalCommand="st"
      '';
      ".config/icewm/keys".text = ''
        key "Super+Enter" st -f monospace-12pt
        key "Super+Shift+r" icewm --restart
      '';
      ".config/icewm/menu".text = ''
        prog "Terminal" xterm st -f inconsolata-12pt
        includeprog icewm-menu-fdo --sep-before --no-sep-others --no-sub-cats
      '';
      ".config/icewm/toolbar".text = ''
        prog "Terminal" xterm st -f inconsolata-12pt
        prog "Dillo" dillo dillo
      '';
    };
    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
    tmux

    # GUI
    st
    dillo
    links2
    pcmanfm
    qutebrowser
    netsurf.browser
  ];
  programs.vim.defaultEditor = true;

  # services.openssh.enable = true;

  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];

  system.copySystemConfiguration = true;

  system.stateVersion = "22.11";

}