From bcbad668c547e83c3ed7ba37394c489654bf78b2 Mon Sep 17 00:00:00 2001 From: Anish L Date: Mon, 18 Apr 2022 00:26:27 +1000 Subject: [PATCH] cube up --- flake.nix | 13 +++--- hosts/cube/configuration.nix | 58 +++++++++++++++++++++++++++ hosts/cube/default.nix | 10 +++++ hosts/cube/hardware-configuration.nix | 29 ++++++++++++++ 4 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 hosts/cube/configuration.nix create mode 100644 hosts/cube/default.nix create mode 100644 hosts/cube/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 3967d4f1..4f6f2267 100644 --- a/flake.nix +++ b/flake.nix @@ -103,9 +103,10 @@ #modules = [ ]; # nixos-hardware.nixosModules.lenovo-thinkpad # Yubikey }; - box = { }; - hypercube = { }; - work = { }; + cube = { }; + # box = { }; + # hypercube = { }; + # work = { }; }; importables = rec { profiles = digga.lib.rakeLeaves ./profiles // { @@ -130,11 +131,11 @@ profiles = digga.lib.rakeLeaves ./users/profiles; suites = with profiles; rec { hmBase = [ direnv git ]; - #gui = [ base profiles.firefox profiles.desktop ]; + gui = [ hmBase profiles.firefox profiles.desktop ]; }; }; users = { - nixos = { suites, ... }: { imports = suites.base; }; + nixos = { suites, ... }: { imports = suites.hmBase; }; curve = { suites, ... }: { imports = suites.gui; }; }; # digga.lib.importers.rakeLeaves ./users/hm; }; @@ -154,7 +155,7 @@ }; }; - checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib; + # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy.lib; } ; } diff --git a/hosts/cube/configuration.nix b/hosts/cube/configuration.nix new file mode 100644 index 00000000..7ce9a331 --- /dev/null +++ b/hosts/cube/configuration.nix @@ -0,0 +1,58 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only + + networking.hostName = "cube"; # Define your hostname. + + # Set your time zone. + time.timeZone = "Australia/Brisbane"; + + # Use flakes + nix = { + package = pkgs.nixFlakes; # or versioned attributes like nix_2_7 + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.ens3.useDHCP = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.anish = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDM0Zvei46x/yZl/IeBCq6+IYQQ0avulzVyBysF9cPigZMCybWRV7IEU+E3k9t6JrbdbdGfJkcZIWmsWDdKS8W8mBnZpVoT0ffLynu8JQ/TKdGm4Qv6bgUeKNrGsNv0ZPs2CDaGSLj0oJfRF7Ko10tcLP0vW+yujrh+y6TH/vVzJioaV4TGvtCUpn+wEQah9ROwPQLUUofsSWdnRsDJ/gp37zXWs4l5wyjSKtP3O9RZUP7kBekbSqEgSXiTk0oUQSVqIWl9NDiP6onk/gSOjXsR/JPqsSN/XI/c/yj6gyY0f51Ru2D7iBxuMJIJcWV+rU6coIj+ULcQWLzt/7TI8jq5AOOzI/ll4zbL24Eo84Rz+TP9tvMMhDZ0VaMN22AJ8qQEjc5P09tWKsX7Jg39XelyV1jHXncE4yvIE9F4RSCHzWCeKeXakizQNuzSaxTxIExRFYHjNW5bR6+3MTGwVrEIXU+qML+0yFTR86MT+tdY5AreAJQLwbog79O1NupeXJE= anish@curve" ]; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + ]; + + services.openssh.enable = true; + + # THIS VALUE DETERMINES THE nixOS RELEASE FROM WHICH THE DEFAULT + # SETTINGS FOR STATEFUL DATA, LIKE FILE LOCATIONS AND DATABASE VERSIONS + # ON YOUR SYSTEM WERE TAKEN. iT‘S PERFECTLY FINE AND RECOMMENDED TO LEAVE + # THIS VALUE AT THE RELEASE VERSION OF THE FIRST INSTALL OF THIS SYSTEM. + # BEFORE CHANGING THIS VALUE READ THE DOCUMENTATION FOR THIS OPTION + # (E.G. MAN CONFIGURATION.NIX OR ON HTTPS://NIXOS.ORG/NIXOS/OPTIONS.HTML). + system.stateVersion = "21.11"; # DID YOU READ THE COMMENT? + +} + diff --git a/hosts/cube/default.nix b/hosts/cube/default.nix new file mode 100644 index 00000000..d93a24f2 --- /dev/null +++ b/hosts/cube/default.nix @@ -0,0 +1,10 @@ +{ profiles, suites, ... }: +{ + imports = [ + ./configuration.nix + ]; # ++ [suites.cube]; + + #home-manager.users.anish = { self, suites, ... }: { + # imports = [ ] ++ suites.hmBase; + #}; +} diff --git a/hosts/cube/hardware-configuration.nix b/hosts/cube/hardware-configuration.nix new file mode 100644 index 00000000..323fc578 --- /dev/null +++ b/hosts/cube/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9233d8be-539f-43c8-9b83-84b5b4d72a93"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E00D-9070"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}