From 3c4acde325751dcc29db747acaa8554226e0c84a Mon Sep 17 00:00:00 2001 From: arouzing Date: Wed, 1 Feb 2023 03:11:48 -0500 Subject: [PATCH] working! --- .modules/base/hardware.nix | 11 ++--- .modules/services/docker.nix | 2 +- .modules/services/openssh.nix | 2 +- .modules/users/arouzing.nix | 2 +- flake.lock | 79 +++++++++++++++++++++++++++++++++++ flake.nix | 6 +-- hosts/example.nix | 22 +++++----- result | 1 + 8 files changed, 104 insertions(+), 21 deletions(-) create mode 100644 flake.lock create mode 120000 result diff --git a/.modules/base/hardware.nix b/.modules/base/hardware.nix index 911c2a2..0622787 100644 --- a/.modules/base/hardware.nix +++ b/.modules/base/hardware.nix @@ -1,12 +1,13 @@ {config, lib, pkgs, modulesPath, ... }: { + system.stateVersion = "22.11"; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usbhid" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" "wl" ]; -# boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "usbhid" "sd_mod" "sdhci_pci" ]; + # boot.initrd.kernelModules = [ "dm-snapshot" ]; + # boot.kernelModules = [ "kvm-intel" "wl" ]; + # boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + # hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } \ No newline at end of file diff --git a/.modules/services/docker.nix b/.modules/services/docker.nix index f7bbff1..97e3d00 100644 --- a/.modules/services/docker.nix +++ b/.modules/services/docker.nix @@ -1,4 +1,4 @@ -_: { config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { virtualisation.docker = { enable = true; diff --git a/.modules/services/openssh.nix b/.modules/services/openssh.nix index b390dcf..37a0252 100644 --- a/.modules/services/openssh.nix +++ b/.modules/services/openssh.nix @@ -1,7 +1,7 @@ _: { config, pkgs, lib, ... }: { - services.openssh = lib.mkDefault{ + services.openssh = { enable = true; openFirewall = true; startWhenNeeded = true; diff --git a/.modules/users/arouzing.nix b/.modules/users/arouzing.nix index f033176..a5fb4a8 100644 --- a/.modules/users/arouzing.nix +++ b/.modules/users/arouzing.nix @@ -1,4 +1,4 @@ -_: { config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: { users.users.arouzing = { isNormalUser = true; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5a27957 --- /dev/null +++ b/flake.lock @@ -0,0 +1,79 @@ +{ + "nodes": { + "nixlib": { + "locked": { + "lastModified": 1636849918, + "narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1674666581, + "narHash": "sha256-KNI2s/xrL7WOYaPJAWKBtb7cCH3335rLfsL+B+ssuGY=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "6a5dc1d3d557ea7b5c19b15ff91955124d0400fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1675153841, + "narHash": "sha256-EWvU3DLq+4dbJiukfhS7r6sWZyJikgXn6kNl7eHljW8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ea692c2ad1afd6384e171eabef4f0887d2b882d3", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs-small": { + "locked": { + "lastModified": 1675154384, + "narHash": "sha256-gUXzyTS3WsO3g2Rz0qOYR2a26whkyL2UfTr1oPH9mm8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0218941ea68b4c625533bead7bbb94ccce52dceb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixos-generators": "nixos-generators", + "nixpkgs": "nixpkgs", + "nixpkgs-small": "nixpkgs-small" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 568a548..4cde06e 100644 --- a/flake.nix +++ b/flake.nix @@ -6,15 +6,15 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, ... }@inputs: + outputs = { self, nixos-generators, nixpkgs, ... }@inputs: { example = nixos-generators.nixosGenerate { system = "x86_64-linux"; modules = [ ./hosts/example.nix ]; - format = "qcow"; + format = "virtualbox"; }; - apps."x86_64-linux".default = lollypops.apps."x86_64-linux".default { configFlake = self; }; + }; } \ No newline at end of file diff --git a/hosts/example.nix b/hosts/example.nix index 0fd1a62..fe6ace0 100644 --- a/hosts/example.nix +++ b/hosts/example.nix @@ -3,15 +3,17 @@ { imports = [ # Include the results of the hardware scan. - ./.modules/base/hardware.nix - ./.modules/services/docker.nix - ./.modules/arouzing.nix + # ../.modules/base/hardware.nix + # ../.modules/services/docker.nix + ../.modules/users/arouzing.nix + ../.modules/services/openssh.nix ]; # base packages environment.systemPackages = with pkgs; [ htop vim + # sleep # tailscale ]; @@ -21,17 +23,17 @@ networkmanager.enable = true; }; - services.tailscale.enable = true; + # services.tailscale.enable = true; time.timeZone = "America/New_York"; # Open ports in the firewall. - networking.firewall = { - enable = true; - allowedTCPPorts = []; - allowedUDPPorts = []; - }; + # networking.firewall = { + # enable = true; + # allowedTCPPorts = []; + # allowedUDPPorts = []; + # }; ## main services - + system.stateVersion = "22.11"; } \ No newline at end of file diff --git a/result b/result new file mode 120000 index 0000000..7537bed --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/yjmyc0nj40qmc35b63mwkgsnhhrbm3yb-nixos-ova-23.05.20230131.ea692c2-x86_64-linux \ No newline at end of file