citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

configuration.nix (3507B)


      1 # Edit this configuration file to define what should be installed on
      2 # your system.  Help is available in the configuration.nix(5) man page
      3 # and in the NixOS manual (accessible by running ‘nixos-help’).
      4 
      5 { config, pkgs, ... }:
      6 
      7 let machine = extra.private.machine;
      8     isDesktop = machine != "purple";
      9     machinePath = p: let m = "/" + machine;
     10                      in ./machines + m + p;
     11     machineConfig = import (machinePath "/config") pkgs;
     12     userConfig = pkgs.callPackage ./nixpkgs/dotfiles.nix {
     13       machineSessionCommands = machineConfig.sessionCommands;
     14     };
     15     extra = {
     16       is-minimal = false;
     17       git-server = import ./misc/git-server.nix;
     18       util       = import ./misc/util.nix { inherit pkgs; };
     19       private    = import ./private.nix { inherit pkgs; };
     20       machine    = machineConfig;
     21     };
     22     util = extra.util;
     23     caches = [ "https://cache.nixos.org" ];
     24     composeKey = if machine == "quiver" then "ralt" else "prsc";
     25     home = "/home/jb55";
     26     isDark = false;
     27     bash = "${pkgs.bashInteractive}/bin/bash";
     28     theme = if isDark then {
     29       package = pkgs.theme-vertex;
     30       name = "Vertex-Dark";
     31     }
     32     else {
     33       package = pkgs.arc-theme;
     34       name = "Arc";
     35     };
     36     icon-theme = {
     37       package = pkgs.numix-icon-theme;
     38       name = "Numix";
     39     };
     40     user = {
     41         name = "jb55";
     42         isNormalUser = true;
     43         group = "users";
     44         uid = 1000;
     45         extraGroups = [ "wheel" "dialout" ];
     46         createHome = true;
     47         openssh.authorizedKeys.keys = [
     48           "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAvMdnEEAd/ZQM+pYp6ZYG/1NPE/HSwIKoec0/QgGy4UlO0EvpWWhxPaV0HlNUFfwiHE0I2TwHc+KOKcG9jcbLAjCk5rvqU7K8UeZ0v/J83bQh78dr4le09WLyhczamJN0EkNddpCyUqIbH0q3ISGPmTiW4oQniejtkdJPn2bBwb3Za8jLzlh2UZ/ZJXhKvcGjQ/M1+fBmFUwCp5Lpvg0XYXrmp9mxAaO+fxY32EGItXcjYM41xr/gAcpmzL5rNQ9a9YBYFn2VzlpL+H7319tgdZa4L57S49FPQ748paTPDDqUzHtQD5FEZXe7DZZPZViRsPc370km/5yIgsEhMPKr jb55"
     49         ];
     50         home = home;
     51         shell = bash;
     52       };
     53 in {
     54   imports =
     55     [ # Include the results of the hardware scan.
     56       ./hardware-configuration.nix
     57       ./certs
     58       (import ./services extra)
     59       (import ./environment extra)
     60       (import ./networking machine)
     61       (import (machinePath "") extra)
     62     ] ++ (if isDesktop then [
     63       (import ./hardware/desktop extra)
     64       # ./wayland
     65       (import ./fonts extra)
     66       (import ./environment/desktop { inherit userConfig theme icon-theme extra; })
     67       (import ./services/desktop { inherit extra util composeKey userConfig theme icon-theme; })
     68     ] else []);
     69 
     70   # Use the GRUB 2 boot loader.
     71   boot.loader.grub.enable = true;
     72   #environment.ld-linux = false;
     73   systemd.extraConfig = ''
     74     DefaultTimeoutStopSec=10s
     75     DefaultTimeoutStartSec=20s
     76   '';
     77 
     78   i18n.extraLocaleSettings = {
     79     LC_TIME="en_DK.UTF-8";
     80   };
     81 
     82   documentation.nixos.enable = false;
     83   documentation.dev.enable = true;
     84   #documentation.man.generateCaches = true; # list manpages
     85 
     86   programs.ssh.startAgent = true;
     87 
     88   time.timeZone = "America/Vancouver";
     89 
     90   nixpkgs.config = import ./nixpkgs/config.nix;
     91 
     92   nix.useSandbox = machine != "charon";
     93   nix.settings.experimental-features = [ "nix-command" "flakes" ];
     94   nix.trustedUsers = [ "root" "jb55" ];
     95 
     96   boot.blacklistedKernelModules = [ "pcspkr" ]; # STOP THE BEEPING
     97 
     98   users.extraUsers.jb55 = user;
     99   users.extraGroups.docker.members = [ "jb55" ];
    100 
    101   users.defaultUserShell = bash;
    102   users.mutableUsers = true;
    103 
    104   console.useXkbConfig = true;
    105 
    106   programs.zsh.enable = false;
    107 
    108 }