├── .github
└── workflows
│ └── code_check.yml
├── .gitignore
├── CONTRIBUTING.md
├── README.md
├── c
├── .editorconfig
├── .gitignore
├── Makefile
├── flake.nix
├── hello.nix
└── main.c
├── darwin
├── core.nix
├── flake.nix
├── home.nix
├── homebrew.nix
└── system.nix
├── direnv
├── .envrc
└── flake.nix
├── flake.lock
├── flake.nix
├── home-manager
├── flake.nix
└── home.nix
└── system
├── configuration.nix
├── flake.nix
└── hardware-configuration.nix
/.github/workflows/code_check.yml:
--------------------------------------------------------------------------------
1 | name: Code Check
2 | on:
3 | push:
4 | branches:
5 | - "*"
6 | pull_request:
7 | branches:
8 | - "*"
9 | jobs:
10 | lint:
11 | name: Run nixfmt and statix
12 | runs-on: ubuntu-latest
13 | steps:
14 | - name: Check out the code
15 | uses: actions/checkout@v4
16 | - name: Install Nix
17 | uses: cachix/install-nix-action@v26
18 | - name: Install nixfmt and statix
19 | run: |
20 | nix profile install nixpkgs#nixfmt-rfc-style nixpkgs#statix
21 | - name: Run nixfmt
22 | run: |
23 | nixfmt --check ./**/*.nix
24 | - name: Run statix
25 | run: |
26 | statix check
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .direnv/
2 | */flake.lock
3 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing!
2 |
3 | Hi, first of all, thank you for considering contributing to Aux! We are always looking for new contributors to help us improve the project. We appreciate your help!
4 |
5 | ## How to contribute
6 |
7 | We would like for you to follow these set of rules when contributing to Aux:
8 |
9 | - Format your code with `nix fmt` before submitting a pull request.
10 | - Ensure that your commits and PR title are in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
11 | - Follow our Code of Conduct.
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > [!WARNING]
2 | > **This repository has moved!**
3 | > You can contribute or find up-to-date content at https://git.auxolotl.org/auxolotl/templates
4 |
5 |
6 |
Welcome to Aux
7 |
8 |
9 |
10 | This is a template repository for getting started with your brand new Auxolotl system.
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ### Getting Started
21 |
22 | There are 3 main templates in this repository:
23 | - `darwin` - The system configuration for the Darwin operating system (macOS)
24 | - `system` - The system configuration for the Linux operating system
25 | - `home-manager` - The configuration for the home-manager
26 |
27 | #### With Darwin (macOS)
28 |
29 | 1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t github:auxolotl/templates#darwin NixFiles` in the terminal. This will setup the basic configuration for the system, this generate a configuration for you from the files located in the `darwin` directory.
30 | 2. The next step is to go into the `NixFiles` directory this can be achieved by running `cd NixFiles`.
31 | 3. Now we you need to read over the configuration files and make any changes that you see fit, some of these must include changing your username and hostname.
32 | 4. You now must rebuild this configuration we can do this with `nix run darwin -- switch --flake .#hostname` hostname should be substituted for your systems hostname.
33 | 5. After your first run you are now able to use the `darwin-rebuild switch --flake .` command to rebuild your system.
34 |
35 | #### With NixOS
36 |
37 | 1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t github:auxolotl/templates#system NixFiles`
38 | 2. Move into your new system with `cd NixFiles`
39 | 3. Fill in your `hostName` in `flake.nix`
40 | 4. Run `nixos-generate-config --show-hardware-config > hardware-configuration.nix` to generate configuration based on your filesystems and drivers
41 | 5. Run `nixos-rebuild build --flake .#hostName`, replacing hostName with your new hostName
42 |
43 | Congratulations, you are now using Aux!
44 |
45 | #### With Home-manager
46 |
47 | 1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t github:auxolotl/templates#home-manager NixFiles` to start
48 | 2. Move into your new Nix system with `cd NixFiles`
49 | 3. Fill in your `username` in `flake.nix`
50 |
--------------------------------------------------------------------------------
/c/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | indent_size = 4
7 | indent_style = space
8 | insert_final_newline = true
9 | max_line_length = 80
10 | tab_width = 4
11 |
12 | [{Makefile,*.mk}]
13 | indent_style = tab
14 |
15 | [*.nix]
16 | indent_style = space
17 | tab_width = 2
18 | indent_size = 2
19 |
20 | [*.lock]
21 | indent_style = unset
22 | insert_final_newline = unset
23 |
--------------------------------------------------------------------------------
/c/.gitignore:
--------------------------------------------------------------------------------
1 | # binaries
2 | hello
3 |
4 | # language support
5 | compile_commands.json
6 | .cache
7 |
8 | # nix
9 | .direnv
10 | result*
11 | repl-result-*
12 |
13 | # Prerequisites
14 | *.d
15 |
16 | # Object files
17 | *.o
18 | *.ko
19 | *.obj
20 | *.elf
21 |
22 | # Linker output
23 | *.ilk
24 | *.map
25 | *.exp
26 |
27 | # Precompiled Headers
28 | *.gch
29 | *.pch
30 |
31 | # Libraries
32 | *.lib
33 | *.a
34 | *.la
35 | *.lo
36 |
37 | # Shared objects (inc. Windows DLLs)
38 | *.dll
39 | *.so
40 | *.so.*
41 | *.dylib
42 |
43 | # Executables
44 | *.exe
45 | *.out
46 | *.app
47 | *.i*86
48 | *.x86_64
49 | *.hex
50 |
51 | # Debug files
52 | *.dSYM/
53 | *.su
54 | *.idb
55 | *.pdb
56 |
57 | # Kernel Module Compile Results
58 | *.mod*
59 | *.cmd
60 | .tmp_versions/
61 | modules.order
62 | Module.symvers
63 | Mkfile.old
64 | dkms.conf
65 |
--------------------------------------------------------------------------------
/c/Makefile:
--------------------------------------------------------------------------------
1 | CC ?= gcc
2 | CFLAGS += -pedantic -Wall -Wextra -O2
3 |
4 | OUT := hello
5 | BINDIR ?= /usr/bin
6 |
7 | SRC += main.c
8 | OBJ := $(SRC:.c=.o)
9 |
10 | .PHONY: all
11 | all: $(OUT)
12 |
13 | $(OUT): $(OBJ)
14 | $(CC) -o $@ $<
15 |
16 | .PHONY: clean
17 | clean:
18 | $(RM) $(OBJ)
19 |
20 | .PHONY: fclean
21 | fclean: clean
22 | $(RM) -r $(OUT)
23 |
24 | .PHONY: re
25 | .NOTPARALLEL: re
26 | re: fclean all
27 |
28 | .PHONY: install
29 | install:
30 | install -D hello ${BINDIR}/hello --mode 0755
31 |
--------------------------------------------------------------------------------
/c/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "Aux template for C project";
3 |
4 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
5 |
6 | outputs =
7 | { nixpkgs, ... }:
8 | let
9 | forAllSystems =
10 | function:
11 | nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
12 | system: function nixpkgs.legacyPackages.${system}
13 | );
14 | in
15 | rec {
16 | devShells = forAllSystems (pkgs: {
17 | default = pkgs.mkShell { inputsFrom = [ packages.${pkgs.system}.hello ]; };
18 | });
19 |
20 | packages = forAllSystems (pkgs: rec {
21 | default = hello;
22 | hello = pkgs.callPackage ./hello.nix { };
23 | });
24 |
25 | overlays.default = final: prev: { hello = prev.callPackage ./default.nix { }; };
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/c/hello.nix:
--------------------------------------------------------------------------------
1 | { stdenv }:
2 | stdenv.mkDerivation {
3 | name = "hello";
4 | src = ./.;
5 |
6 | env.BINDIR = "${placeholder "out"}/bin";
7 | }
8 |
--------------------------------------------------------------------------------
/c/main.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main(void)
5 | {
6 | char greet[] = "hello, world!\n";
7 | int written = printf("%s", greet);
8 |
9 | return written == (sizeof(greet) - 1)
10 | ? EXIT_SUCCESS : EXIT_FAILURE;
11 | }
12 |
--------------------------------------------------------------------------------
/darwin/core.nix:
--------------------------------------------------------------------------------
1 | { config, lib, ... }:
2 | {
3 | # Auto upgrade nix package and the daemon service.
4 | services.nix-daemon.enable = true;
5 |
6 | nix.settings = {
7 | # We need this to be able to use the nix-command and flakes features.
8 | # these are essential to use this system configuration as a flake.
9 | experimental-features = [
10 | "nix-command"
11 | "flakes"
12 | ];
13 |
14 | # this allows the system builder to use substitutes
15 | builders-use-substitutes = true;
16 |
17 | # we want these because we don't have to build every package from source
18 | substituters = [ "https://nix-community.cachix.org" ];
19 | trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
20 |
21 | # We also want to add our defined users to the trusted-users list
22 | # this is important so that we can use the substituters with no issues
23 | trusted-users = lib.attrNames config.users.users;
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/darwin/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "A simple darwin flake using Aux and home-manager";
3 |
4 | inputs = {
5 | # nixpkgs is the input that we use for this flake the end section `nixpkgs-unstable` refers to the branch
6 | # of nixpkgs that we want to use. This can be changed to any branch or commit hash.
7 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
8 |
9 | home-manager = {
10 | url = "github:nix-community/home-manager";
11 |
12 | # The `follows` keyword in inputs is used for inheritance.
13 | # we do this in order to prevent duplication of the nixpkgs input, and potential
14 | # issues with different versions of given packages.
15 | # However, it should be noted that this can lead to having to rebuild packages from source.
16 | inputs.nixpkgs.follows = "nixpkgs";
17 | };
18 |
19 | darwin = {
20 | url = "github:lnl7/nix-darwin";
21 | inputs.nixpkgs.follows = "nixpkgs";
22 | };
23 | };
24 |
25 | outputs =
26 | inputs@{ darwin, home-manager, ... }:
27 | # we can use the `let` and `in` syntax to define variables
28 | # and use them in the rest of the expression
29 | let
30 | # this can be either aarch64-darwin or x86_64-darwin
31 | # if your using a M1 or later your going to need to use aarch64-darwin
32 | # otherwise you can use x86_64-darwin
33 | system = builtins.abort "You need to fill in your system";
34 |
35 | # here we define our username and hostname to reuse them later
36 | username = builtins.abort "You need to fill in your username"; # Set this variable equal to your username
37 | hostname = builtins.abort "You need to fill in your hostname"; # Set this variable equal to your hostname
38 |
39 | # the specialArgs are used to pass the inputs to the system configuration and home-manager configuration
40 | specialArgs = {
41 | inherit inputs;
42 | };
43 | in
44 | {
45 | # it is important that you use darwin.lib.darwinSystem as this is the builder that allow
46 | # for the configuration of the darwin system
47 | darwinConfigurations.${hostname} = darwin.lib.darwinSystem {
48 | inherit system;
49 |
50 | # The specialArgs are used to pass the inputs to the system configuration
51 | inherit specialArgs;
52 |
53 | modules = [
54 | ./core.nix
55 | ./homebrew.nix
56 | ./system.nix
57 |
58 | # The home-manager module is used to configure home-manager
59 | # to read more about this please see ../home-manager
60 | home-manager.darwinModules.home-manager
61 | (
62 | { config, ... }:
63 | {
64 | home-manager = {
65 | useGlobalPkgs = true;
66 | useUserPackages = true;
67 |
68 | # extraSpecialArgs is used to pass the inputs to the home-manager configuration
69 | extraSpecialArgs = specialArgs;
70 |
71 | # And a home-manager configuration for them
72 | users.${username} = {
73 | imports = [ ./home.nix ];
74 |
75 | home.username = username;
76 | };
77 | };
78 | # Here we can create our user
79 | uses.users.${username} = {
80 | home = "/Users/${username}";
81 | };
82 |
83 | # Here we set our (networking) host name and computer name. They should usually be the same
84 | networking.hostName = hostname;
85 | networking.computerName = config.networking.hostName;
86 | }
87 | )
88 | ];
89 | };
90 | };
91 | }
92 |
--------------------------------------------------------------------------------
/darwin/home.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 | {
3 | # Home Manager needs a bit of information about you and the
4 | # paths it should manage.
5 | home = {
6 | # remember we set this in our flake.nix file
7 | homeDirectory = "/Users/${config.home.username}";
8 |
9 | # This value determines the Home Manager release that your
10 | # configuration is compatible with. This helps avoid breakage
11 | # when a new Home Manager release introduces backwards
12 | # incompatible changes.
13 | #
14 | # You can update Home Manager without changing this value. See
15 | # the Home Manager release notes for a list of state version
16 | # changes in each release.
17 | stateVersion = "23.11";
18 | };
19 |
20 | # Let Home Manager install and manage itself.
21 | programs.home-manager.enable = true;
22 | }
23 |
--------------------------------------------------------------------------------
/darwin/homebrew.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 | {
3 | config = {
4 | environment = {
5 | # You can configure your usual shell environment for homebrew here.
6 | variables = {
7 | HOMEBREW_NO_ANALYTICS = "1";
8 | HOMEBREW_NO_INSECURE_REDIRECT = "1";
9 | HOMEBREW_NO_EMOJI = "1";
10 | HOMEBREW_NO_ENV_HINTS = "0";
11 | };
12 |
13 | # This is included so that the homebrew packages are available in the PATH.
14 | systemPath = [ config.homebrew.brewPrefix ];
15 | };
16 |
17 | # homebrew need to be installed manually, see https://brew.sh
18 | # The apps installed by homebrew are not managed by nix, and not reproducible!
19 | homebrew = {
20 | enable = true;
21 | caskArgs.require_sha = true;
22 |
23 | onActivation = {
24 | autoUpdate = true;
25 | upgrade = true;
26 | # 'zap': uninstalls all formulae(and related files) not listed here.
27 | cleanup = "zap";
28 | };
29 |
30 | # Applications to install from Mac App Store using mas.
31 | # You need to install all these Apps manually first so that your apple account have records for them.
32 | # otherwise Apple Store will refuse to install them.
33 | # For details, see https://github.com/mas-cli/mas
34 | masApps = { };
35 |
36 | taps = [ "homebrew/bundle" ];
37 |
38 | # This is the equivalent of running `brew install`
39 | brews = [
40 | "curl"
41 | "openjdk"
42 | ];
43 |
44 | # This is the equivalent of running `brew install --cask`
45 | casks = [
46 | "arc" # browser
47 | "zed" # text editor
48 | "raycast" # app launcher, and clipboard manager
49 | "obsidian" # note taking
50 | "inkscape" # vector graphics editor
51 | ];
52 | };
53 | };
54 | }
55 |
--------------------------------------------------------------------------------
/darwin/system.nix:
--------------------------------------------------------------------------------
1 | { config, ... }:
2 | # This section apply settings to the system configuration only available on macOS
3 | # see for more options
4 | {
5 | system = {
6 | # remember to set the hostname in the kernel command line
7 | defaults.smb.NetBIOSName = config.networking.hostName;
8 |
9 | # Add ability to used TouchID for sudo authentication
10 | security.pam.enableSudoTouchIdAuth = true;
11 |
12 | # Create /etc/zshrc that loads the nix-darwin environment.
13 | # this is required if you want to use darwin's default shell - zsh
14 | programs.zsh.enable = true;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/direnv/.envrc:
--------------------------------------------------------------------------------
1 | if has nix_direnv_version; then
2 | use flake
3 | fi
--------------------------------------------------------------------------------
/direnv/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "An empty devshell with direnv support";
3 |
4 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
5 |
6 | outputs =
7 | { nixpkgs, ... }:
8 | let
9 | forAllSystems =
10 | function:
11 | nixpkgs.lib.genAttrs [
12 | "x86_64-linux"
13 | "aarch64-linux"
14 | "x86_64-darwin"
15 | "aarch64-darwin"
16 | ] (system: function nixpkgs.legacyPackages.${system});
17 | in
18 | {
19 | devShells = forAllSystems (pkgs: {
20 | default = pkgs.mkShellNoCC {
21 | packages = [ pkgs.hello ];
22 | EXAMPLE_VAR = "inside the direnv template";
23 | shellHook = ''
24 | echo "Hello from $EXAMPLE_VAR, $(whoami)!"
25 | '';
26 | };
27 | });
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "nixpkgs": {
4 | "locked": {
5 | "lastModified": 1714562304,
6 | "narHash": "sha256-Mr3U37Rh6tH0FbaDFu0aZDwk9mPAe7ASaqDOGgLqqLU=",
7 | "owner": "auxolotl",
8 | "repo": "nixpkgs",
9 | "rev": "bcd44e224fd68ce7d269b4f44d24c2220fd821e7",
10 | "type": "github"
11 | },
12 | "original": {
13 | "owner": "auxolotl",
14 | "ref": "nixpkgs-unstable",
15 | "repo": "nixpkgs",
16 | "type": "github"
17 | }
18 | },
19 | "root": {
20 | "inputs": {
21 | "nixpkgs": "nixpkgs"
22 | }
23 | }
24 | },
25 | "root": "root",
26 | "version": 7
27 | }
28 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "Templates for getting started with Aux";
3 |
4 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
5 |
6 | outputs =
7 | { self, nixpkgs }:
8 | let
9 | forAllSystems =
10 | function:
11 | nixpkgs.lib.genAttrs [
12 | "x86_64-linux"
13 | "aarch64-linux"
14 | "x86_64-darwin"
15 | "aarch64-darwin"
16 | ] (system: function nixpkgs.legacyPackages.${system});
17 | in
18 | {
19 | templates = {
20 | default = self.templates.system;
21 | system = {
22 | path = ./system;
23 | description = "";
24 | };
25 | home-manager = {
26 | path = ./home-manager;
27 | description = "";
28 | };
29 | darwin = {
30 | path = ./darwin;
31 | description = "";
32 | };
33 | direnv = {
34 | path = ./direnv;
35 | description = "An empty devshell with direnv support";
36 | };
37 | };
38 | formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
39 | };
40 | }
41 |
--------------------------------------------------------------------------------
/home-manager/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "A simple home-manager flake using Aux";
3 |
4 | inputs = {
5 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
6 |
7 | home-manager = {
8 | url = "github:nix-community/home-manager";
9 |
10 | # The `follows` keyword in inputs is used for inheritance.
11 | # we do this in order to prevent duplication of the nixpkgs input, and potential
12 | # issues with different versions of given packages.
13 | # However, it should be noted that this can lead to having to rebuild packages from source.
14 | inputs.nixpkgs.follows = "nixpkgs";
15 | };
16 | };
17 |
18 | outputs =
19 | inputs@{ nixpkgs, home-manager, ... }:
20 | let
21 | system = "x86_64-linux";
22 | pkgs = nixpkgs.legacyPackages.${system};
23 | username = builtins.abort "You need to fill in your username"; # Set this variable equal to your username
24 | in
25 | {
26 | homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
27 | inherit pkgs;
28 |
29 | # Specify your home configuration modules here, for example,
30 | # the path to your home.nix.
31 | modules = [
32 | ./home.nix
33 |
34 | { home.username = username; }
35 | ];
36 |
37 | # Optionally use extraSpecialArgs
38 | # to pass through arguments to home.nix
39 | extraSpecialArgs = {
40 | inherit inputs;
41 | };
42 | };
43 | };
44 | }
45 |
--------------------------------------------------------------------------------
/home-manager/home.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 | {
3 | # Home Manager needs a bit of information about you and the paths it should
4 | # manage.
5 | home = {
6 | homeDirectory = "/home/${config.home.username}";
7 |
8 | # This value determines the Home Manager release that your configuration is
9 | # compatible with. This helps avoid breakage when a new Home Manager release
10 | # introduces backwards incompatible changes.
11 | #
12 | # You should not change this value, even if you update Home Manager. If you do
13 | # want to update the value, then make sure to first check the Home Manager
14 | # release notes.
15 | stateVersion = "23.11"; # Please read the comment before changing.
16 |
17 | # The home.packages option allows you to install Nix packages into your
18 | # environment.
19 | packages = [
20 | # # Adds the 'hello' command to your environment. It prints a friendly
21 | # # "Hello, world!" when run.
22 | # pkgs.hello
23 |
24 | # # It is sometimes useful to fine-tune packages, for example, by applying
25 | # # overrides. You can do that directly here, just don't forget the
26 | # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
27 | # # fonts?
28 | # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
29 |
30 | # # You can also create simple shell scripts directly inside your
31 | # # configuration. For example, this adds a command 'my-hello' to your
32 | # # environment:
33 | # (pkgs.writeShellScriptBin "my-hello" ''
34 | # echo "Hello, ${config.home.username}!"
35 | # '')
36 | ];
37 |
38 | # Home Manager is pretty good at managing dotfiles. The primary way to manage
39 | # plain files is through 'home.file'.
40 | file = {
41 | # # Building this configuration will create a copy of 'dotfiles/screenrc' in
42 | # # the Nix store. Activating the configuration will then make '~/.screenrc' a
43 | # # symlink to the Nix store copy.
44 | # ".screenrc".source = dotfiles/screenrc;
45 |
46 | # # You can also set the file content immediately.
47 | # ".gradle/gradle.properties".text = ''
48 | # org.gradle.console=verbose
49 | # org.gradle.daemon.idletimeout=3600000
50 | # '';
51 | };
52 |
53 | # Home Manager can also manage your environment variables through
54 | # 'home.sessionVariables'. If you don't want to manage your shell through Home
55 | # Manager then you have to manually source 'hm-session-vars.sh' located at
56 | # either
57 | #
58 | # ~/.nix-profile/etc/profile.d/hm-session-vars.sh
59 | #
60 | # or
61 | #
62 | # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
63 | #
64 | # or
65 | #
66 | # /etc/profiles/per-user/abhiram/etc/profile.d/hm-session-vars.sh
67 | #
68 | sessionVariables = {
69 | # EDITOR = "emacs";
70 | };
71 | };
72 |
73 | # Let Home Manager install and manage itself.
74 | programs.home-manager.enable = true;
75 | }
76 |
--------------------------------------------------------------------------------
/system/configuration.nix:
--------------------------------------------------------------------------------
1 | {
2 | config,
3 | lib,
4 | pkgs,
5 | ...
6 | }:
7 |
8 | {
9 | imports = [
10 | # Include the results of the hardware scan.
11 | ./hardware-configuration.nix
12 | ];
13 |
14 | # Use the systemd-boot EFI boot loader.
15 | boot.loader.systemd-boot.enable = true;
16 | boot.loader.efi.canTouchEfiVariables = true;
17 |
18 | # Pick only one of the below networking options.
19 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
20 | # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
21 |
22 | # Set your time zone.
23 | # time.timeZone = "Europe/Amsterdam";
24 |
25 | # Configure network proxy if necessary
26 | # networking.proxy.default = "http://user:password@proxy:port/";
27 | # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
28 |
29 | # Select internationalisation properties.
30 | # i18n.defaultLocale = "en_US.UTF-8";
31 | # console = {
32 | # font = "Lat2-Terminus16";
33 | # keyMap = "us";
34 | # useXkbConfig = true; # use xkb.options in tty.
35 | # };
36 |
37 | # Enable the X11 windowing system.
38 | # services.xserver.enable = true;
39 |
40 | # Configure keymap in X11
41 | # services.xserver.xkb.layout = "us";
42 | # services.xserver.xkb.options = "eurosign:e,caps:escape";
43 |
44 | # Enable CUPS to print documents.
45 | # services.printing.enable = true;
46 |
47 | # Enable sound.
48 | # hardware.pulseaudio.enable = true;
49 | # OR
50 | # services.pipewire = {
51 | # enable = true;
52 | # pulse.enable = true;
53 | # };
54 |
55 | # Enable touchpad support (enabled default in most desktopManager).
56 | # services.xserver.libinput.enable = true;
57 |
58 | # Define a user account. Don't forget to set a password with ‘passwd’.
59 | users.users.axol = {
60 | isNormalUser = true;
61 | extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
62 | packages = with pkgs; [ firefox ];
63 | };
64 |
65 | # List packages installed in system profile. To search, run:
66 | # $ nix search wget
67 | # environment.systemPackages = with pkgs; [
68 | # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
69 | # wget
70 | # ];
71 |
72 | # Some programs need SUID wrappers, can be configured further or are
73 | # started in user sessions.
74 | # programs.mtr.enable = true;
75 | # programs.gnupg.agent = {
76 | # enable = true;
77 | # enableSSHSupport = true;
78 | # };
79 |
80 | # List services that you want to enable:
81 |
82 | # Enable the OpenSSH daemon.
83 | # services.openssh.enable = true;
84 |
85 | # Open ports in the firewall.
86 | # networking.firewall.allowedTCPPorts = [ ... ];
87 | # networking.firewall.allowedUDPPorts = [ ... ];
88 | # Or disable the firewall altogether.
89 | # networking.firewall.enable = false;
90 |
91 | # Copy the NixOS configuration file and link it from the resulting system
92 | # (/run/current-system/configuration.nix). This is useful in case you
93 | # accidentally delete configuration.nix.
94 | # system.copySystemConfiguration = true;
95 |
96 | # This option allows you to use some features (flakes and the new Nix CLI) which have not yet been stabilized.
97 | # Although they aren't yet stabilized, many Nix users use them and simple workflows are unlikely to break
98 | nix.settings.experimental-features = [
99 | "nix-command"
100 | "flakes"
101 | ];
102 |
103 | nix = {
104 |
105 | gc.automatic = true;
106 |
107 | # This option defines the first version of NixOS you have installed on this particular machine,
108 | # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
109 | #
110 | # Most users should NEVER change this value after the initial install, for any reason,
111 | # even if you've upgraded your system to a new NixOS release.
112 | #
113 | # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
114 | # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
115 | # to actually do that.
116 | #
117 | # This value being lower than the current NixOS release does NOT mean your system is
118 | # out of date, out of support, or vulnerable.
119 | #
120 | # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
121 | # and migrated your data accordingly.
122 | #
123 | # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
124 | };
125 | system.stateVersion = "24.05"; # Did you read the comment?
126 | }
127 |
--------------------------------------------------------------------------------
/system/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "A simple system flake using some Aux defaults";
3 |
4 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
5 |
6 | outputs =
7 | inputs@{ nixpkgs, ... }:
8 | let
9 | system = "x86_64-linux";
10 | hostName = builtins.abort "You need to fill in your hostName"; # Set this variable equal to your hostName
11 | in
12 | {
13 | nixosConfigurations.${hostName} = nixpkgs.lib.nixosSystem {
14 | modules = [
15 | ./configuration.nix
16 |
17 | {
18 | networking.hostName = hostName;
19 | nixpkgs.hostPlatform = system;
20 | }
21 | ];
22 |
23 | specialArgs = {
24 | inherit inputs;
25 | };
26 | };
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/system/hardware-configuration.nix:
--------------------------------------------------------------------------------
1 | builtins.abort "Please run 'nixos-generate-config --show-hardware-config' and copy the output into hardware-configuration.nix"
2 |
--------------------------------------------------------------------------------