From b16d768b013ae436ba8d6b5ff804c71c13f69eb0 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 24 Dec 2023 17:14:10 +0100 Subject: [PATCH] Initialize defiant --- flake.nix | 18 +++++++++++++++++ hosts/defiant/configuration.nix | 34 +++++++++++++++++++++++++++++++++ hosts/defiant/home.nix | 19 ++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 hosts/defiant/configuration.nix create mode 100644 hosts/defiant/home.nix diff --git a/flake.nix b/flake.nix index a79c43c..62c27ea 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,24 @@ } ]; }; + defiant = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs; + }; + modules = [ + # Overlays-module makes "pkgs.unstable" available in configuration.nix + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + + ./hosts/defiant/configuration.nix + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."felixalb" = import ./hosts/defiant/home.nix; + } + ]; + }; edison = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { diff --git a/hosts/defiant/configuration.nix b/hosts/defiant/configuration.nix new file mode 100644 index 0000000..9401246 --- /dev/null +++ b/hosts/defiant/configuration.nix @@ -0,0 +1,34 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ../../base.nix + ../../common/metrics-exporters.nix + ./hardware-configuration.nix + ]; + + networking = { + hostName = "defiant"; + defaultGateway = "192.168.10.1"; + interfaces.eno1.ipv4 = { + addresses = [ + { address = "192.168.10.175"; prefixLength = 24; } + ]; + }; + hostId = "8e84f235"; + }; + + # sops.defaultSopsFile = ../../secrets/defiant/defiant.yaml; + + environment.variables = { EDITOR = "vim"; }; + environment.systemPackages = with pkgs; [ + zfs + ]; + + virtualisation.docker.enable = true; + virtualisation.oci-containers.backend = "docker"; + + system.stateVersion = "23.11"; +} + diff --git a/hosts/defiant/home.nix b/hosts/defiant/home.nix new file mode 100644 index 0000000..84fa68e --- /dev/null +++ b/hosts/defiant/home.nix @@ -0,0 +1,19 @@ +{ pkgs, lib, ... }: +{ + home.packages = with pkgs; [ + bat + bottom + ncdu + neofetch + ]; + + imports = [ + ./../../home/base.nix + ]; + + programs = { + zsh.shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config"; + }; + + home.stateVersion = "23.05"; +}