meta: reorganize nix-os and hosts to single directory nixos
This commit is contained in:
parent
be46e02c61
commit
cb05ce5b44
76 changed files with 54 additions and 52 deletions
|
@ -1,9 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./vm-base.nix
|
|
||||||
../nix-os/desktopManagers/gnome.nix
|
|
||||||
../nix-os/displayManagers/gdm.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -8,22 +8,22 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../nix-os/core.nix
|
../../modules/core.nix
|
||||||
../../nix-os/core-desktop.nix
|
../../modules/core-desktop.nix
|
||||||
../../nix-os/nvidia.nix
|
../../modules/nvidia.nix
|
||||||
../../nix-os/docker.nix
|
../../modules/docker.nix
|
||||||
../../nix-os/razer.nix
|
../../modules/razer.nix
|
||||||
../../nix-os/desktopManagers/cosmic.nix
|
../../modules/desktopManagers/cosmic.nix
|
||||||
../../nix-os/displayManagers/cosmic-greeter.nix
|
../../modules/displayManagers/cosmic-greeter.nix
|
||||||
../../nix-os/shell.nix
|
../../modules/shell.nix
|
||||||
../../nix-os/virtualization.nix
|
../../modules/virtualization.nix
|
||||||
../../nix-os/polkit/disable-shutdown.nix
|
../../modules/polkit/disable-shutdown.nix
|
||||||
../../nix-os/locale.nix
|
../../modules/locale.nix
|
||||||
../../nix-os/adb.nix
|
../../modules/adb.nix
|
||||||
../../nix-os/account.nix
|
../../modules/account.nix
|
||||||
../../nix-os/services/nix-binary-cache.nix
|
../../modules/services/nix-binary-cache.nix
|
||||||
../../nix-os/udev.nix
|
../../modules/udev.nix
|
||||||
../../nix-os/gnupg.nix
|
../../modules/gnupg.nix
|
||||||
|
|
||||||
"${inputs.nixos-vscode-server}"
|
"${inputs.nixos-vscode-server}"
|
||||||
|
|
|
@ -5,18 +5,18 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../nix-os/core.nix
|
../modules/core.nix
|
||||||
../nix-os/core-desktop.nix
|
../modules/core-desktop.nix
|
||||||
../nix-os/account.nix
|
../modules/account.nix
|
||||||
../nix-os/adb.nix
|
../modules/adb.nix
|
||||||
../nix-os/locale.nix
|
../modules/locale.nix
|
||||||
../nix-os/shell.nix
|
../modules/shell.nix
|
||||||
../nix-os/gnupg.nix
|
../modules/gnupg.nix
|
||||||
../nix-os/polkit/network.nix
|
../modules/polkit/network.nix
|
||||||
|
|
||||||
../nix-os/desktopManagers/cosmic.nix
|
../modules/desktopManagers/cosmic.nix
|
||||||
../nix-os/displayManagers/cosmic-greeter.nix
|
../modules/displayManagers/cosmic-greeter.nix
|
||||||
../nix-os/udev.nix
|
../modules/udev.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
|
@ -3,13 +3,13 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
"${modulesPath}/virtualisation/qemu-vm.nix"
|
"${modulesPath}/virtualisation/qemu-vm.nix"
|
||||||
../nix-os/account.nix
|
../modules/account.nix
|
||||||
../nix-os/core.nix
|
../modules/core.nix
|
||||||
../nix-os/core-desktop.nix
|
../modules/core-desktop.nix
|
||||||
../nix-os/locale.nix
|
../modules/locale.nix
|
||||||
../nix-os/polkit/disable-shutdown.nix
|
../modules/polkit/disable-shutdown.nix
|
||||||
../nix-os/shell.nix
|
../modules/shell.nix
|
||||||
../nix-os/udev.nix
|
../modules/udev.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
|
@ -3,8 +3,8 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./vm-base.nix
|
./vm-base.nix
|
||||||
../nix-os/desktopManagers/cosmic.nix
|
../modules/desktopManagers/cosmic.nix
|
||||||
../nix-os/displayManagers/cosmic-greeter.nix
|
../modules/displayManagers/cosmic-greeter.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
9
nixos/hosts/vm-gnome.nix
Normal file
9
nixos/hosts/vm-gnome.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./vm-base.nix
|
||||||
|
../modules/desktopManagers/gnome.nix
|
||||||
|
../modules/displayManagers/gdm.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
inputs,
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
self,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@
|
||||||
package = pkgs.nix-index.override {
|
package = pkgs.nix-index.override {
|
||||||
nix-index-unwrapped = pkgs.nix-index-unwrapped.overrideAttrs (oldAttrs: {
|
nix-index-unwrapped = pkgs.nix-index-unwrapped.overrideAttrs (oldAttrs: {
|
||||||
patches = oldAttrs.patches or [] ++ [
|
patches = oldAttrs.patches or [] ++ [
|
||||||
../pkgs/by-name/ni/nix-index/cnfOutput.patch
|
( builtins.path { path = "${self}/pkgs/by-name/ni/nix-index/cnfOutput.patch"; } )
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ let
|
||||||
'';
|
'';
|
||||||
outputs = [ "out" "share" ];
|
outputs = [ "out" "share" ];
|
||||||
|
|
||||||
wallpaper = ../../media/wallpaper.png;
|
wallpaper = builtins.path { path = "${self}/media/wallpaper.png"; };
|
||||||
corner_radii_theme = "2.0";
|
corner_radii_theme = "2.0";
|
||||||
corner_radii_panel = "2";
|
corner_radii_panel = "2";
|
||||||
};
|
};
|
||||||
|
@ -26,7 +26,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
"${inputs.cosmic-modules}/nixos/cosmic/module.nix"
|
"${inputs.cosmic-modules}/nixos/cosmic/module.nix"
|
||||||
"${self}/nix-os/generic/dconf.nix"
|
"${self}/nixos/modules/generic/dconf.nix"
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
services.desktopManager.cosmic.enable = true;
|
services.desktopManager.cosmic.enable = true;
|
|
@ -54,16 +54,17 @@ self = {
|
||||||
];
|
];
|
||||||
specialArgs = { inherit self inputs; };
|
specialArgs = { inherit self inputs; };
|
||||||
};
|
};
|
||||||
|
baseHostsDir = ./nixos/hosts;
|
||||||
in
|
in
|
||||||
# mapped attrset of nix file paths to attrSet with initialized NixOS configurations,
|
# mapped attrset of nix file paths to attrSet with initialized NixOS configurations,
|
||||||
# whose names are derived from file names
|
# whose names are derived from file names
|
||||||
lib.pipe ./hosts [
|
lib.pipe baseHostsDir [
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
# filter out files that are not .nix files, directories with default.nix or starting with . (dot, hidden files)
|
# filter out files that are not .nix files, directories with default.nix or starting with . (dot, hidden files)
|
||||||
( lib.filterAttrs (name: type:
|
( lib.filterAttrs (name: type:
|
||||||
(
|
(
|
||||||
(type == "regular" && lib.hasSuffix ".nix" name)
|
(type == "regular" && lib.hasSuffix ".nix" name)
|
||||||
|| (type == "directory" && builtins.pathExists "${builtins.toString ./.}/hosts/${name}/default.nix")
|
|| (type == "directory" && builtins.pathExists (baseHostsDir + "/${name}/default.nix"))
|
||||||
)
|
)
|
||||||
&& !lib.hasPrefix "." name
|
&& !lib.hasPrefix "." name
|
||||||
))
|
))
|
||||||
|
@ -71,7 +72,7 @@ self = {
|
||||||
# remove .nix extension
|
# remove .nix extension
|
||||||
name = if type == "directory" then name else builtins.substring 0 (builtins.stringLength name - 4) name;
|
name = if type == "directory" then name else builtins.substring 0 (builtins.stringLength name - 4) name;
|
||||||
# initialize NixOS configuration
|
# initialize NixOS configuration
|
||||||
value = mkNixosSystem ./hosts/${name};
|
value = mkNixosSystem (baseHostsDir + "/${name}");
|
||||||
}))
|
}))
|
||||||
builtins.attrValues
|
builtins.attrValues
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
|
|
|
@ -30,7 +30,7 @@ in self.lib.concatMapAttrs (name: value: {
|
||||||
};
|
};
|
||||||
in lib.getAttrFromPath ( [ "config" ] ++ attrpath ) system;
|
in lib.getAttrFromPath ( [ "config" ] ++ attrpath ) system;
|
||||||
in {
|
in {
|
||||||
"NixOS/nvidia" = mkUpdater ./nix-os/nvidia.nix [ "hardware" "nvidia" "package" ] {};
|
"NixOS/nvidia" = mkUpdater ./nixos/modules/nvidia.nix [ "hardware" "nvidia" "package" ] {};
|
||||||
})
|
})
|
||||||
|
|
||||||
# MARK: packages
|
# MARK: packages
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue