-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
101 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
--- | ||
slug: /nixos-flake | ||
sidebar_label: Systems | ||
short-title: nixos-flake ❄️ | ||
template: | ||
sidebar: | ||
collapsed: true | ||
emanote: | ||
folder-folgezettel: false | ||
--- | ||
|
||
# Managing OS and home configurations using `nixos-flake` | ||
|
||
[nixos-flake](https://github.com/srid/nixos-flake) a [flake-parts](https://flake.parts/) module to unify [NixOS](https://nixos.org/manual/nixos/stable/) + [nix-darwin](https://github.com/LnL7/nix-darwin) + [home-manager] configuration in a single flake, while providing a consistent interface (and enabling common modules) for both Linux and macOS. | ||
|
||
See: [[start]]# and [[guide]]#. For examples, see [[examples]]# | ||
|
||
[home-manager]: https://github.com/nix-community/home-manager | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# For documentation and available settings, see | ||
# https://github.com/srid/emanote/blob/master/emanote/default/index.yaml | ||
|
||
page: | ||
siteTitle: nixos-flake | ||
headHtml: | | ||
<snippet var="js.highlightjs" /> | ||
template: | ||
# You can add your own variables here, like editBaseUrl. | ||
# See after-note.tpl to see where editBaseUrl gets used. | ||
editBaseUrl: https://github.com/srid/nixos-flake/edit/master/doc | ||
|
||
# Uncomment this to get neuron-style pages | ||
# name: /templates/layouts/note | ||
# layout: | ||
# note: | ||
# containerClass: container mx-auto max-w-screen-lg | ||
|
||
sidebar: | ||
collapsed: false | ||
|
||
# If you are hosting on GitLab Pages, you may want to remove this. | ||
urlStrategy: pretty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
order: 10 | ||
--- | ||
|
||
# Examples | ||
|
||
- https://github.com/srid/nixos-config (using `#both` [[templates|template]]) | ||
- https://github.com/hkmangla/nixos (using `#linux` [[templates|template]]) | ||
- https://github.com/juspay/nix-dev-home (using `#home` [[templates|template]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
# Guide | ||
|
||
- [[templates]]# | ||
- [[module-outputs]]# |
4 changes: 0 additions & 4 deletions
4
doc/guide/module-outputs.md → doc/nixos-flake/module-outputs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Flake Templates | ||
|
||
We provide four templates, depending on your needs: | ||
|
||
## Available templates | ||
|
||
{#both} | ||
### Both platforms | ||
|
||
NixOS, nix-darwin, [home-manager] configuration combined, with common modules. | ||
|
||
```bash | ||
nix flake init -t github:srid/nixos-flake | ||
``` | ||
|
||
{#nixos} | ||
### NixOS only | ||
|
||
NixOS configuration only, with [home-manager] | ||
|
||
```sh | ||
nix flake init -t github:srid/nixos-flake#linux | ||
``` | ||
|
||
{#macos} | ||
### macOS only | ||
|
||
nix-darwin configuration only, with [home-manager] | ||
|
||
```sh | ||
nix flake init -t github:srid/nixos-flake#macos | ||
``` | ||
|
||
{#home} | ||
### Home only | ||
|
||
[home-manager] configuration only (useful if you use other Linux distros or do not have admin access to the machine) | ||
|
||
```bash | ||
nix flake init -t github:srid/nixos-flake#home | ||
``` | ||
|
||
## After initializing the template | ||
|
||
1. open the generated `flake.nix` and change the user (from "john") as well as hostname (from "example1") to match that of your environment (Run `echo $USER` and `hostname -s` to determine the new values).[^intel] | ||
2. Then run `nix run .#activate` (`nix run .#activate-home` if you are using the 4th template) to activate the configuration. | ||
|
||
[^intel]: If you are on an Intel Mac, change `mkARMMacosSystem` to `mkIntelMacosSystem`. | ||
|
||
[home-manager]: https://github.com/nix-community/home-manager |