diff options
author | Vincent Ambo <tazjin@google.com> | 2020-01-04T15·08+0000 |
---|---|---|
committer | Vincent Ambo <Vincent Ambo> | 2020-01-04T22·50+0000 |
commit | 1d687c53031277f72a5273b01dab9d4bf37bb862 (patch) | |
tree | b09f359e4e950bc0d655db1241daae932142bf60 /ops | |
parent | 3638048c9bd3b1cc46685bb8a6a0c36c6532fdb5 (diff) |
chore(ops/nixos): Move NixOS configuration one level up r/327
Diffstat (limited to 'ops')
-rw-r--r-- | ops/infra/nixos/default.nix | 6 | ||||
-rw-r--r-- | ops/nixos/.gitignore (renamed from ops/infra/nixos/.gitignore) | 0 | ||||
-rw-r--r-- | ops/nixos/README.md (renamed from ops/infra/nixos/README.md) | 0 | ||||
-rw-r--r-- | ops/nixos/adho-configuration.nix (renamed from ops/infra/nixos/adho-configuration.nix) | 0 | ||||
-rw-r--r-- | ops/nixos/configuration.nix (renamed from ops/infra/nixos/configuration.nix) | 8 | ||||
-rw-r--r-- | ops/nixos/default.nix | 48 | ||||
-rw-r--r-- | ops/nixos/desktop.nix (renamed from ops/infra/nixos/desktop.nix) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles.nix (renamed from ops/infra/nixos/dotfiles.nix) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles/alacritty.yml (renamed from ops/infra/nixos/dotfiles/alacritty.yml) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles/config.fish (renamed from ops/infra/nixos/dotfiles/config.fish) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles/msmtprc (renamed from ops/infra/nixos/dotfiles/msmtprc) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles/notmuch-config (renamed from ops/infra/nixos/dotfiles/notmuch-config) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles/offlineimaprc (renamed from ops/infra/nixos/dotfiles/offlineimaprc) | 0 | ||||
-rw-r--r-- | ops/nixos/dotfiles/tmux.conf (renamed from ops/infra/nixos/dotfiles/tmux.conf) | 0 | ||||
-rw-r--r-- | ops/nixos/home.nix (renamed from ops/infra/nixos/home.nix) | 0 | ||||
-rw-r--r-- | ops/nixos/mail.nix (renamed from ops/infra/nixos/mail.nix) | 0 | ||||
-rw-r--r-- | ops/nixos/packages.nix (renamed from ops/infra/nixos/packages.nix) | 0 | ||||
-rw-r--r-- | ops/nixos/stallo-configuration.nix (renamed from ops/infra/nixos/stallo-configuration.nix) | 0 |
18 files changed, 48 insertions, 14 deletions
diff --git a/ops/infra/nixos/default.nix b/ops/infra/nixos/default.nix deleted file mode 100644 index 42594f6f5859..000000000000 --- a/ops/infra/nixos/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: - -builtins.throw '' - The Nix derivations at infra/nixos are not meant to be evaluated - like a derivation as they represent NixOS configuration. -'' diff --git a/ops/infra/nixos/.gitignore b/ops/nixos/.gitignore index 773fa1667019..773fa1667019 100644 --- a/ops/infra/nixos/.gitignore +++ b/ops/nixos/.gitignore diff --git a/ops/infra/nixos/README.md b/ops/nixos/README.md index 4f2e870f9025..4f2e870f9025 100644 --- a/ops/infra/nixos/README.md +++ b/ops/nixos/README.md diff --git a/ops/infra/nixos/adho-configuration.nix b/ops/nixos/adho-configuration.nix index 11c5a97df59e..11c5a97df59e 100644 --- a/ops/infra/nixos/adho-configuration.nix +++ b/ops/nixos/adho-configuration.nix diff --git a/ops/infra/nixos/configuration.nix b/ops/nixos/configuration.nix index 57f5c56dc798..24320c0c20ec 100644 --- a/ops/infra/nixos/configuration.nix +++ b/ops/nixos/configuration.nix @@ -40,14 +40,6 @@ firewall.allowedTCPPorts = [ 3000 5556 5558 ]; }; - # Generate an immutable /etc/resolv.conf from the nameserver settings - # above (otherwise DHCP overwrites it): - environment.etc."resolv.conf" = with lib; with pkgs; { - source = writeText "resolv.conf" '' - ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)} - options edns0 - ''; - }; # Configure emacs: # (actually, that's a lie, this only installs emacs!) diff --git a/ops/nixos/default.nix b/ops/nixos/default.nix new file mode 100644 index 000000000000..c73a1ac73403 --- /dev/null +++ b/ops/nixos/default.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: + +let + inherit (pkgs) third_party lib; + configuration = rec { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.cleanTmpDir = true; + hardware.pulseaudio.enable = true; + hardware.cpu.intel.updateMicrocode = true; + time.timeZone = "Europe/London"; + + networking = { + # Don't use ISP's DNS servers: + nameservers = [ + "8.8.8.8" + "8.8.4.4" + ]; + + # Open Chromecast-related ports & servedir + firewall.allowedTCPPorts = [ 3000 5556 5558 ]; + }; + + # Generate an immutable /etc/resolv.conf from the nameserver settings + # above (otherwise DHCP overwrites it): + environment.etc."resolv.conf" = with lib; with pkgs; { + source = writeText "resolv.conf" '' + ${concatStringsSep "\n" (map (ns: "nameserver ${ns}") networking.nameservers)} + options edns0 + ''; + }; + + nixpkgs.config.allowUnfree = true; + }; + + # Desktop at home + stallo = { + networking.hostName = "stallo"; + services.xserver.videoDrivers = [ "nvidia" ]; + boot.initrd.luks.devices.stallo-luks.device = "/dev/disk/by-uuid/b484cf1e-a27b-4785-8bd6-fa85a004b073"; + + fileSystems."/".device = "/dev/disk/by-label/stallo-root"; + }; +in { + stallo = third_party.nixos { + configuration = lib.recursiveUpdate configuration stallo; + }; +} diff --git a/ops/infra/nixos/desktop.nix b/ops/nixos/desktop.nix index 07a6274a568c..07a6274a568c 100644 --- a/ops/infra/nixos/desktop.nix +++ b/ops/nixos/desktop.nix diff --git a/ops/infra/nixos/dotfiles.nix b/ops/nixos/dotfiles.nix index 2e952207d47d..2e952207d47d 100644 --- a/ops/infra/nixos/dotfiles.nix +++ b/ops/nixos/dotfiles.nix diff --git a/ops/infra/nixos/dotfiles/alacritty.yml b/ops/nixos/dotfiles/alacritty.yml index d229fbdde67f..d229fbdde67f 100644 --- a/ops/infra/nixos/dotfiles/alacritty.yml +++ b/ops/nixos/dotfiles/alacritty.yml diff --git a/ops/infra/nixos/dotfiles/config.fish b/ops/nixos/dotfiles/config.fish index de2c99ae6007..de2c99ae6007 100644 --- a/ops/infra/nixos/dotfiles/config.fish +++ b/ops/nixos/dotfiles/config.fish diff --git a/ops/infra/nixos/dotfiles/msmtprc b/ops/nixos/dotfiles/msmtprc index 624b6a77fc4b..624b6a77fc4b 100644 --- a/ops/infra/nixos/dotfiles/msmtprc +++ b/ops/nixos/dotfiles/msmtprc diff --git a/ops/infra/nixos/dotfiles/notmuch-config b/ops/nixos/dotfiles/notmuch-config index a490774e635f..a490774e635f 100644 --- a/ops/infra/nixos/dotfiles/notmuch-config +++ b/ops/nixos/dotfiles/notmuch-config diff --git a/ops/infra/nixos/dotfiles/offlineimaprc b/ops/nixos/dotfiles/offlineimaprc index 78315447e4bd..78315447e4bd 100644 --- a/ops/infra/nixos/dotfiles/offlineimaprc +++ b/ops/nixos/dotfiles/offlineimaprc diff --git a/ops/infra/nixos/dotfiles/tmux.conf b/ops/nixos/dotfiles/tmux.conf index 6c20ae0370b2..6c20ae0370b2 100644 --- a/ops/infra/nixos/dotfiles/tmux.conf +++ b/ops/nixos/dotfiles/tmux.conf diff --git a/ops/infra/nixos/home.nix b/ops/nixos/home.nix index 236091cb019d..236091cb019d 100644 --- a/ops/infra/nixos/home.nix +++ b/ops/nixos/home.nix diff --git a/ops/infra/nixos/mail.nix b/ops/nixos/mail.nix index ba4ebfa06026..ba4ebfa06026 100644 --- a/ops/infra/nixos/mail.nix +++ b/ops/nixos/mail.nix diff --git a/ops/infra/nixos/packages.nix b/ops/nixos/packages.nix index b90a4a9ee8b4..b90a4a9ee8b4 100644 --- a/ops/infra/nixos/packages.nix +++ b/ops/nixos/packages.nix diff --git a/ops/infra/nixos/stallo-configuration.nix b/ops/nixos/stallo-configuration.nix index 4af4a5fd4c22..4af4a5fd4c22 100644 --- a/ops/infra/nixos/stallo-configuration.nix +++ b/ops/nixos/stallo-configuration.nix |