diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2377d20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +example/*/flake.lock +example/*/hardware-configuration.nix diff --git a/README.md b/README.md index 04a9c04..4300872 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,15 @@ NixOS-95/ nix.settings.experimental-features = ["nix-command" "flakes" "pipe-operators"]; Enabled +You can initilize a new flake-based configuration with: +``` +# minimal +nix flake init -t github:Peritia-System/NixOS-95/Dev +# with home-manager +nix flake init -t github:Peritia-System/NixOS-95/Dev#home-manager +``` + +Or follow the manual installation process: ### 1. Add Nyx to your flake diff --git a/example/default/configuration.nix b/example/default/configuration.nix new file mode 100644 index 0000000..710e991 --- /dev/null +++ b/example/default/configuration.nix @@ -0,0 +1,63 @@ +{ pkgs, ... }: { + + system.stateVersion = "25.05"; + nix.settings.experimental-features = [ + "flakes" "nix-command" "pipe-operators" + ]; + + nixos95 = { + enable = true; + user = "alice"; + + taskbar = { + homeIcon = "whisker-menu-button"; + battery-plugin.enable = false; + applications = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Firefox"; + description = "Browse the Web"; + pkg = pkgs.firefox; + icon = "world"; + } + { + name = "Signal"; + description = "Private Messenger"; + pkg = pkgs.signal-desktop; + icon = "signal"; + } + ]; + }; + + keybinds = { + commands = [ + { key="l"; exe="xflock4"; } + ]; + }; + }; + + users.users.alice = { + isNormalUser = true; + initialPassword = "password"; + home = "/home/alice"; + createHome = true; + + packages = [ + pkgs.firefox + pkgs.neovim + pkgs.signal-desktop + ]; + }; + + networking.hostName = "nixos95"; + networking.networkmanager.enable = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + +} diff --git a/example/default/flake.nix b/example/default/flake.nix new file mode 100644 index 0000000..6b163c5 --- /dev/null +++ b/example/default/flake.nix @@ -0,0 +1,25 @@ +{ + description = "Nixos95 example configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + nixos95 = { + url = "github:Peritia-System/NixOS-95"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, nixos95, ... }: { + + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + system = "x84_64-linux"; + modules = [ + nixos95.nixosModules.default + ./configuration.nix + ./hardware-configuration.nix + ]; + }; + + }; +} diff --git a/example/home-manager/configuration.nix b/example/home-manager/configuration.nix new file mode 100644 index 0000000..d994db5 --- /dev/null +++ b/example/home-manager/configuration.nix @@ -0,0 +1,66 @@ +{ pkgs, ... }: { + + system.stateVersion = "25.05"; + nix.settings.experimental-features = [ + "flakes" "nix-command" "pipe-operators" + ]; + + nixos95 = { + enable = true; + user = "alice"; + + taskbar = { + homeIcon = "whisker-menu-button"; + battery-plugin.enable = false; + applications = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Firefox"; + description = "Browse the Web"; + pkg = pkgs.firefox; + icon = "world"; + } + { + name = "Signal"; + description = "Private Messenger"; + pkg = pkgs.signal-desktop; + icon = "signal"; + } + ]; + }; + + keybinds = { + commands = [ + { key="l"; exe="xflock4"; } + ]; + }; + }; + + networking.hostName = "nixos95"; + users.users.alice = { + isNormalUser = true; + initialPassword = "password"; + home = "/home/alice"; + createHome = true; + }; + + home-manager.users.alice = { + programs.firefox.enable = true; + programs.neovim.enable = true; + + home.packages = [ + pkgs.signal-desktop + ]; + }; + + networking.networkmanager.enable = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + +} diff --git a/example/home-manager/flake.nix b/example/home-manager/flake.nix new file mode 100644 index 0000000..fbd677d --- /dev/null +++ b/example/home-manager/flake.nix @@ -0,0 +1,33 @@ +{ + description = "Nixos95 example configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixos95 = { + url = "github:Peritia-System/NixOS-95"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + }; + + outputs = { nixpkgs, nixos95, home-manager, ... }: { + + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + system = "x84_64-linux"; + modules = [ + nixos95.nixosModules.default + home-manager.nixosModules.home-manager + + ./configuration.nix + ./hardware-configuration.nix + ]; + }; + + }; +} diff --git a/flake.nix b/flake.nix index bb07cc5..638c74b 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,30 @@ outputs = { self, nixpkgs, home-manager,... }: { nixosModules.default = import ./nixos95 { inherit home-manager; }; + + templates.default = { + description = "Minimal Nixos-95 configuration"; + path = ./example/default; + welcomeText = '' + # Welcome to Nixos95 + + Please run `ǹixos-generate-config --dir .` to generate hardware configuration. + + > You can now continue with Step 3 in the README.md + ''; + }; + + templates.default = { + description = "Minimal Nixos-95 configuration with home-manager"; + path = ./example/home-manager; + welcomeText = '' + # Welcome to Nixos95 (with home-manager) + + Please run `nixos-generate-config --dir .` to generate harde configuration. + + > You can now continue with Step 3 in the README.md + ''; + }; }; }