Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/st0rmingbr4in/nix-config
https://github.com/st0rmingbr4in/nix-config
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/st0rmingbr4in/nix-config
- Owner: St0rmingBr4in
- Created: 2021-06-07T21:59:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T19:06:28.000Z (9 months ago)
- Last Synced: 2024-02-06T20:25:37.665Z (9 months ago)
- Language: Nix
- Size: 104 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Add a new system
```
$ NIXOS_SYSTEM_CONFIG_NAME=new-system
```Follow https://nixos.org/manual/nixos/stable/index.html#sec-installation until 2.3.4
run :
```
$ sudo nixos-generate-config --root /mnt --show-hardware-config >> ${NIXOS_SYSTEM_CONFIG_NAME}-hardware-configuration.nix
```Add the generated hardware config to a file in this repo and import it in the new nixosSystem config
```
diff --git a/flake.nix b/flake.nix
index 9e3a3a7..97572a3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -14,10 +14,23 @@
outputs = { self, nixpkgs, homeManager, nixosHardware }: {
nixosConfigurations = {
+ new-system = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ ./config.nix
+ ./new-system-hardware-configuration.nix
+ homeManager.nixosModules.home-manager {
+ home-manager.useGlobalPkgs = true;
+ home-manager.useUserPackages = true;
+ home-manager.users.st0rmingbr4in = import ./home.nix;
+ }
+ ];
+ };
nixos-test = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./config.nix
homeManager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;```
Commit and push
```
sudo nixos-install --refresh --flake "github:St0rmingBr4in/nix-config/master#${NIXOS_SYSTEM_CONFIG_NAME}" --no-write-lock-file
```# Update an existing system
```
sudo nixos-rebuild boot --refresh --flake "github:St0rmingBr4in/nix-config/master#${NIXOS_SYSTEM_CONFIG_NAME}" --no-write-lock-file
```# To test locally
```
docker run -it -v $(pwd):/nix-config --workdir="/nix-config" --platform linux/amd64 nixos/nix nix build --refresh --extra-experimental-features flakes --extra-experimental-features nix-command .#nixosConfigurations.media-pc.config.system.build.toplevel
```