From d4bc0d6f754c76f992fac29b3df1d73feace9fed Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Thu, 24 Jun 2021 22:43:32 -0400 Subject: [PATCH] Refactor main into a common dir --- common/darwin.nix | 5 +++++ {main => common}/desktop.nix | 0 {main => common}/fonts.nix | 0 main/general.nix => common/linux.nix | 4 ++++ {main => common}/netdata/default.nix | 0 {main => common}/netdata/netdata.conf | 0 {main => common}/networking.nix | 0 {main => common}/packages.nix | 2 +- {main => common}/printing.nix | 0 flake.lock | 12 ++++++------ flake.nix | 18 +++++++++--------- main/kernel.nix | 9 --------- 12 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 common/darwin.nix rename {main => common}/desktop.nix (100%) rename {main => common}/fonts.nix (100%) rename main/general.nix => common/linux.nix (89%) rename {main => common}/netdata/default.nix (100%) rename {main => common}/netdata/netdata.conf (100%) rename {main => common}/networking.nix (100%) rename {main => common}/packages.nix (99%) rename {main => common}/printing.nix (100%) delete mode 100644 main/kernel.nix diff --git a/common/darwin.nix b/common/darwin.nix new file mode 100644 index 0000000..267fc67 --- /dev/null +++ b/common/darwin.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + nix.extraOptions = "experimental-features = nix-command flakes"; +} diff --git a/main/desktop.nix b/common/desktop.nix similarity index 100% rename from main/desktop.nix rename to common/desktop.nix diff --git a/main/fonts.nix b/common/fonts.nix similarity index 100% rename from main/fonts.nix rename to common/fonts.nix diff --git a/main/general.nix b/common/linux.nix similarity index 89% rename from main/general.nix rename to common/linux.nix index 25e4c7d..03b603f 100644 --- a/main/general.nix +++ b/common/linux.nix @@ -13,6 +13,10 @@ nixpkgs.config.allowUnfree = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + # Enable support for additional filesystems + boot.supportedFilesystems = [ "ntfs" ]; + # Define a user account. Don't forget to set a password with ‘passwd’. users.users.dave = { isNormalUser = true; diff --git a/main/netdata/default.nix b/common/netdata/default.nix similarity index 100% rename from main/netdata/default.nix rename to common/netdata/default.nix diff --git a/main/netdata/netdata.conf b/common/netdata/netdata.conf similarity index 100% rename from main/netdata/netdata.conf rename to common/netdata/netdata.conf diff --git a/main/networking.nix b/common/networking.nix similarity index 100% rename from main/networking.nix rename to common/networking.nix diff --git a/main/packages.nix b/common/packages.nix similarity index 99% rename from main/packages.nix rename to common/packages.nix index 3d6b117..bbbb81a 100644 --- a/main/packages.nix +++ b/common/packages.nix @@ -92,7 +92,7 @@ in # imaging gifsicle - # gimp + gimp # video youtube-dl diff --git a/main/printing.nix b/common/printing.nix similarity index 100% rename from main/printing.nix rename to common/printing.nix diff --git a/flake.lock b/flake.lock index 3040441..0441b1d 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1624417001, - "narHash": "sha256-IQZwbBBmvtNZGz1dogf2TcaMALqQJG6YSRJiUMw6hhY=", + "lastModified": 1624575530, + "narHash": "sha256-KSzJG1O0tqJ13K4NPOdc0X3Hh2MJe3ZWTJJv0Tis+J4=", "owner": "nix-community", "repo": "home-manager", - "rev": "b42fce7aaae71bbf5160d88b1772cd9167b03d1a", + "rev": "7e2b1a42aaf709bb982dd1dad6f1f3bba290d64d", "type": "github" }, "original": { @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1624359033, - "narHash": "sha256-VUCSle6emCfIwMItRfMuDl2UCUNrN+AXCMV6l1AZM7E=", + "lastModified": 1624447853, + "narHash": "sha256-Zn+vTEa3NE9q6z6ytpcNXrr8jV7HvrKRxMYoD2E6DpE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d2b489b24ae30278ad31e06801c3853b0edbbd9d", + "rev": "1905f5f2e55e0db0bb6244cfe62cb6c0dbda391d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9985790..5aeec97 100644 --- a/flake.nix +++ b/flake.nix @@ -17,14 +17,13 @@ let defaultModules = [ home-manager.nixosModules.home-manager - # ./main/desktop.nix - ./main/fonts.nix - ./main/general.nix - ./main/kernel.nix - ./main/netdata/default.nix - ./main/networking.nix - ./main/packages.nix - ./main/printing.nix + # ./common/desktop.nix + ./common/fonts.nix + ./common/linux.nix + ./common/netdata/default.nix + ./common/networking.nix + ./common/packages.nix + ./common/printing.nix ({ config, lib, lib', ... }: { config = { @@ -66,8 +65,9 @@ darwinConfigurations = { demeter = darwin.lib.darwinSystem { modules = [ + ./common/darwin.nix + ./common/packages.nix ./machines/demeter/configuration.nix - ./main/packages.nix ({ config, ... }: { config = { diff --git a/main/kernel.nix b/main/kernel.nix deleted file mode 100644 index 5ea29cf..0000000 --- a/main/kernel.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: - -{ - # Use the latest kernel - boot.kernelPackages = pkgs.linuxPackages_latest; - - # Enable support for additional filesystems - boot.supportedFilesystems = [ "ntfs" ]; -}