Skip to content

Commit

Permalink
laptop: add docs, add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Jun 21, 2024
1 parent 379039b commit b348a8d
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
104 changes: 104 additions & 0 deletions README.md
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...
}
```
6 changes: 6 additions & 0 deletions modules/laptop/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
enable = true;
lfs.enable = true;
};

virtualisation.docker = {
enable = true;
# save resources
enableOnBoot = false;
};
}

0 comments on commit b348a8d

Please sign in to comment.