-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Based on [Misterio's starter config example](https://github.com/Misterio77/nix-starter-configs).
- Loading branch information
0 parents
commit e8f92db
Showing
5 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
/result |
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,15 @@ | ||
# My nix configuration | ||
|
||
This is a nix flake defining my system and user configurations. It is currently work in progress and very incomplete. | ||
|
||
## Initial bootstrap | ||
|
||
If the experimental feature `nix-command` and `flakes` not enabled, run `nix-shell` from this directory to enable them. | ||
|
||
Run `nixos-rebuild --flake .#matts-laptop` to install the system configuration. | ||
|
||
Run `home-manager --flake .#matt@matts-laptop` to install the user configuration. | ||
|
||
## Updating | ||
|
||
TODO |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
description = "My nix config"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
|
||
home-manager = { | ||
url = "github:nix-community/home-manager/master"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, home-manager, ... }@inputs: | ||
let | ||
inherit (self) outputs; | ||
forAllSystems = nixpkgs.lib.genAttrs [ | ||
"aarch64-linux" | ||
"i686-linux" | ||
"x86_64-linux" | ||
"aarch64-darwin" | ||
"x86_64-darwin" | ||
]; | ||
in | ||
rec { | ||
# Devshell for bootstrapping | ||
# Acessible through `nix develop` or `nix-shell` (legacy) | ||
devShells = forAllSystems (system: | ||
let pkgs = nixpkgs.legacyPackages.${system}; | ||
in import ./shell.nix { inherit pkgs; } | ||
); | ||
|
||
# TODO Add any overlays/modules here? | ||
|
||
# NixOS configuration entrypoint | ||
# Available through `nixos-rebuild --flake .#matts-laptop` | ||
nixosConfigurations = { | ||
matts-laptop = nixpkgs.lib.nixosSystem { | ||
specialArgs = { inherit inputs outputs; }; | ||
modules = [ | ||
# Main nixos configuration file | ||
./nixos/configuration.nix | ||
]; | ||
}; | ||
}; | ||
|
||
# Standalone home-manager configuration entrypoint | ||
# Available through `home-manager --flake .#matt@matts-laptop` | ||
homeConfigurations = { | ||
"matt@matts-laptop" = home-manager.lib.homeManagerConfiguration { | ||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance | ||
extraSpecialArgs = { inherit inputs outputs; }; | ||
modules = [ | ||
# Main home-manager configuration file | ||
./home-manager/home.nix | ||
]; | ||
}; | ||
}; | ||
}; | ||
} |
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,10 @@ | ||
# Shell for bootstrapping flake-enabled nix and home-manager | ||
# You can enter it through 'nix develop' or (legacy) 'nix-shell' | ||
|
||
{ pkgs ? (import ./nixpkgs.nix) { } }: { | ||
default = pkgs.mkShell { | ||
# Enable experimental features without having to specify the argument | ||
NIX_CONFIG = "experimental-features = nix-command flakes"; | ||
nativeBuildInputs = with pkgs; [ nix home-manager git ]; | ||
}; | ||
} |