From 01652d39d4258a796201c487402b5c90a5d99f38 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Fri, 17 Jan 2025 13:52:20 +0800 Subject: [PATCH] one final fix and update docs btw Signed-off-by: Andrei Jiroh Halili --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++- shared/meta-configs.nix | 2 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11db844..03dd4cb 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,45 @@ nix flake update sudo nixos-rebuild --flake .#{hostname} ``` +### As an external flake module + +You can easily use this flake as an external module in your own flake-based NixOS configuration +if you want to reuse some of my configurations. + +```nix +{ + description = "My NixOS configuration"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/24.11"; + inputs.andreijiroh-dev.url = "github:andreijiroh-dev/nixops-config"; + # needed if you use stable instead of unstable + inputs.andreijiroh-dev.inputs.nixpkgs.follows = "nixpkgs"; + + outputs = { self, andreijiroh-dev, nixpkgs }: { + let + # change {hostname} to something like stellapent-cier + # if you like to reuse my configs + system = nixops-config.nixosConfigurations.{hostname}; + in + { + nixosConfigurations.{hostname} = system { + # your customizations here + }; + + nixosConfigurations.your-mom = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + andreijiroh-dev.nixosModules.networking # or any other modules + ]; + }; + }; +} +``` + ### Building a minimial ISO for recovery -Currently available as `amd64` (`x86-64`) Linux ISO only for now. +Currently available as `amd64` (`x86-64`) Linux ISO only for now, but you can copy +the `recoverykit-amd64` NixOS configuration and change `system` to any supported CPU +architectures by NixOS. ```bash # Build using the sources as remote @@ -107,6 +143,17 @@ nix build github:andreijiroh-dev/nixops-config/main#nixosConfigurations.recovery nix build .#nixosConfigurations.recoverykit-amd64.config.system.build.isoImage ``` +## Availabled shared configs + +- [`flatpak.nix`](./shared/flatpak.nix): NixOS for enabling Flatpaks +- [`gnupg.nix`](./shared/gnupg.nix): GnuPG configuration +- [`locale.nix`](./shared/locale.nix): Locale configuration +- [`meta-configs.nix`](./shared/meta-configs.nix): Meta configurations for the system, mostly related to Nix and nixpkgs. +- [`networking.nix`](./shared/networking.nix): Networking configuration, currently DNS resolver settings for `systemd-resolved` +- [`ssh-keys.nix`](./shared/ssh-keys.nix): SSH keys configuration as NixOS module, intended to be in sync with my keys on git forges +- [`server/devenv.nix`](./shared/server/devenv.nix): Development environment configuration, plus Docker and VM configurations. +- [`server/ssh.nix`](./shared/server/ssh.nix): SSH server configuration + ## License MPL-2.0 diff --git a/shared/meta-configs.nix b/shared/meta-configs.nix index 70c7816..4739a87 100644 --- a/shared/meta-configs.nix +++ b/shared/meta-configs.nix @@ -85,7 +85,7 @@ # Needed since Determinate Nix manages the main config file for system. environment.etc."nix/nix.custom.conf" = { - source = ./misc/nix/nix.custom.conf; + source = ../misc/nix/nix.custom.conf; mode = "0644"; }; }