diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..45b5ca3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +secrets/** filter=git-crypt diff=git-crypt diff --git a/configuration.nix b/configuration.nix index 93e05f5..25d5e60 100644 --- a/configuration.nix +++ b/configuration.nix @@ -5,17 +5,19 @@ { config, pkgs, lib, ... }: let - local = import ./local.nix { inherit config pkgs lib; }; - hostName = local.networking.hostName; - host-config = ./machines + "/${hostName}.nix"; - optionalPath = path: lib.lists.optional (builtins.pathExists path) path; + # local = import ./local.nix { inherit config pkgs lib; }; + # hostName = local.networking.hostName; + # host-config = ./machines + "/${hostName}.nix"; + # optionalPath = path: lib.lists.optional (builtins.pathExists path) path; in { imports = [ - - ./hardware-configuration.nix - ./local.nix + # + # ./hardware-configuration.nix + # ./local.nix ./cachix.nix - ] ++ optionalPath host-config; + ]; # ++ optionalPath host-config; + + documentation.info.enable = lib.mkForce false; # Nix ###################################################################### system.stateVersion = "20.03"; # Leave this alone (see configuration.nix(5)) @@ -68,7 +70,7 @@ in { users.groups.jez = { }; users.users.elly.isNormalUser = true; - home-manager.users.jez = import ./home/jez/home.nix; + # home-manager.users.jez = import ./home/jez/home.nix; environment.shells = with pkgs; [ bashInteractive bash fish zsh ]; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..198e413 --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixos" + ] + }, + "locked": { + "lastModified": 1621794721, + "narHash": "sha256-JXfTSZUu9EVbT9D/MFsx0cXfa8bw1NFCzIxZ7gO73Uo=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "90493027e33ba9eb3f50dc1da365d0e4ca31bf14", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "latest": { + "locked": { + "lastModified": 1621793326, + "narHash": "sha256-yt4MOSZttklXCb/UJ9sPAGR7m7JF+3nAXLijjkCCoZk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ab51a2dbd6b5fcc8f6ae467075a2863ecac7c7d0", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixos": { + "locked": { + "lastModified": 1621728353, + "narHash": "sha256-cgRKslcI/lG5wnxgt1z6OGm+JnzmBqyR8m/JzpUNpYQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "900115a4f7fdd9189e7803ca781a65be663f2c89", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "latest": "latest", + "nixos": "nixos" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c0e22d2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "A very basic flake"; + + inputs = { + nixos.url = "nixpkgs/nixos-unstable"; + latest.url = "nixpkgs"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixos"; + }; + + outputs = { self, nixos, latest, home-manager }: { + + nixosConfigurations = { + arianrhod = nixos.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ./hosts/arianrhod + ./hosts/arianrhod/hardware.nix + ./secrets/arianrhod.nix + home-manager.nixosModules.home-manager + # { + # home-manager.useGlobalPkgs = true; + # home-manager.useUserPackages = true; + # home-manager.users.jdoe = import ./home.nix; + # } + ]; + }; + }; + + + }; +} diff --git a/machines/arianrhod.nix b/hosts/arianrhod/default.nix similarity index 75% rename from machines/arianrhod.nix rename to hosts/arianrhod/default.nix index 1e4a2f3..c173d7b 100644 --- a/machines/arianrhod.nix +++ b/hosts/arianrhod/default.nix @@ -1,7 +1,9 @@ { config, pkgs, lib, ... }: { - imports = [ ../bits/home-common.nix ../bits/zfs.nix ]; + imports = [ ../../bits/home-common.nix ../../bits/zfs.nix ]; + + networking.hostName = "arianrhod"; networking.interfaces.enp0s25.useDHCP = true; networking.interfaces.wlp2s0.useDHCP = true; diff --git a/hosts/arianrhod/hardware.nix b/hosts/arianrhod/hardware.nix new file mode 100644 index 0000000..c3560ed --- /dev/null +++ b/hosts/arianrhod/hardware.nix @@ -0,0 +1,49 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "puddle/ROOT/nixos"; + fsType = "zfs"; + }; + + fileSystems."/home" = + { device = "puddle/DATA/home"; + fsType = "zfs"; + }; + + fileSystems."/root" = + { device = "puddle/DATA/home/root"; + fsType = "zfs"; + }; + + fileSystems."/home/jez" = + { device = "puddle/DATA/home/jez"; + fsType = "zfs"; + }; + + fileSystems."/puddle" = + { device = "puddle"; + fsType = "zfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/4A6A-FC6D"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/machines/gwydion.nix b/hosts/gwydion/default.nix similarity index 100% rename from machines/gwydion.nix rename to hosts/gwydion/default.nix diff --git a/secrets/arianrhod.nix b/secrets/arianrhod.nix new file mode 100644 index 0000000..793b384 Binary files /dev/null and b/secrets/arianrhod.nix differ