-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
110 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 |
---|---|---|
@@ -1,3 +1,107 @@ | ||
# nixos-common | ||
|
||
Common modules and packages used across mgit nixos configurations | ||
|
||
# Adding laptop configuration | ||
|
||
We provide nixos base configurations that install all necesarry things such as git, git ansible integration or dev tools. | ||
|
||
There are three available configs: | ||
- base: Tools needed for all teams (git, docker, etc.) | ||
- devops: base + Tools and integrations for deployments (ansible, etc.) | ||
- dev: base + Tools for development (go, etc.) | ||
|
||
# Installation (flakes) | ||
|
||
This method uses the special args method for convinience | ||
|
||
#### In flake.nix, add to inputs: | ||
```nix | ||
inputs.mgit.url = "github:mgit-at/nixos-common/master"; | ||
inputs.mgit.inputs.nixpkgs.follows = "nixpkgs"; | ||
``` | ||
|
||
#### Modify outputs in flake.nix: | ||
|
||
before: | ||
```nix | ||
{ | ||
outputs = { nixpkgs }: { | ||
# your stuff... | ||
}; | ||
} | ||
``` | ||
|
||
after: | ||
|
||
```nix | ||
{ | ||
outputs = { self, nixpkgs, ... } @inputs: let # add self and @inputs, start a let | ||
inherit (self) outputs; # add this | ||
in # end the let | ||
{ | ||
# your stuff... | ||
}; | ||
} | ||
``` | ||
|
||
#### Modify all nixosConfigurations in flake.nix: | ||
|
||
before: | ||
```nix | ||
{ | ||
nixosConfigurations.my-machine = nixpkgs.lib.nixosSystem { | ||
modules = [ | ||
# your stuff... | ||
]; | ||
}; | ||
} | ||
``` | ||
|
||
after: | ||
```nix | ||
{ | ||
nixosConfigurations.my-machine = nixpkgs.lib.nixosSystem { | ||
specialArgs = {inherit inputs outputs;}; # add this | ||
modules = [ | ||
# your stuff... | ||
]; | ||
}; | ||
} | ||
``` | ||
|
||
#### Add to one of your configuration files: | ||
|
||
before: | ||
|
||
```nix | ||
{ config, pkgs, lib, ... }: { | ||
imports = [ | ||
# your stuff... | ||
]; | ||
nixpkgs.overlays = [ | ||
# your stuff... | ||
]; | ||
# your stuff... | ||
} | ||
``` | ||
|
||
after: | ||
|
||
```nix | ||
{ inputs, config, pkgs, lib, ... }: { # add inputs here | ||
imports = [ | ||
inputs.mgit.nixosModules.laptop.all # or devops, or dev | ||
# your stuff... | ||
]; | ||
nixpkgs.overlays = [ | ||
inputs.mgit.overlays.default | ||
# your stuff... | ||
]; | ||
# your stuff... | ||
} | ||
``` |
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