Skip to content

Commit

Permalink
readme: move to usage_laptop, link in readem
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Jun 26, 2024
1 parent a681c7b commit 1ab088b
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 99 deletions.
102 changes: 3 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,104 +4,8 @@ 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.
See [ » Laptop Usage ](./USAGE_LAPTOP.md)

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.)
# Creating infra repo / Deploying server

## 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...
}
```
See [ « Server Usage ](./USAGE_SERVER.md)
103 changes: 103 additions & 0 deletions USAGE_LAPTOP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 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...
}
```
File renamed without changes.

0 comments on commit 1ab088b

Please sign in to comment.