diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7e3e1f7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "My NixOS / nix-darwin / nixos-generators systems"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + snowfall-lib = { + url = "github:snowfallorg/lib"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs: + inputs.snowfall-lib.mkFlake { + inherit inputs; + + src = ./.; + }; +} diff --git a/modules/snowfall/default.nix b/modules/snowfall/default.nix new file mode 100644 index 0000000..d6c6adb --- /dev/null +++ b/modules/snowfall/default.nix @@ -0,0 +1,17 @@ +{ + lib, + config, + ... +}: let + cfg = config.snowfallorg.example; +in { + options.snowfallorg.example = { + enable = lib.mkEnableOption "Snowfall Example"; + }; + + config = lib.mkIf cfg.enable { + environment.variables = { + SNOWFALLORG_EXAMPLE = "enabled"; + }; + }; +} diff --git a/systems/x86_64-linux/example/default.nix b/systems/x86_64-linux/example/default.nix new file mode 100644 index 0000000..16ba0f4 --- /dev/null +++ b/systems/x86_64-linux/example/default.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + imports = [./hardware.nix]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + users.users.example = { + isNormalUser = true; + extraGroups = ["wheel"]; + }; + + environment.systemPackages = with pkgs; [ + neovim + firefox + ]; + + system.stateVersion = "22.05"; +} diff --git a/systems/x86_64-linux/example/hardware.nix b/systems/x86_64-linux/example/hardware.nix new file mode 100644 index 0000000..2f60dd4 --- /dev/null +++ b/systems/x86_64-linux/example/hardware.nix @@ -0,0 +1,21 @@ +{modulesPath, ...}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/nixos"; + fsType = "vfat"; + }; + + swapDevices = [ + {device = "/dev/disk/by-label/swap";} + ]; + + networking.useDHCP = true; +}