Skip to content

Commit

Permalink
feat ✨: add colmena
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Hang <vhvictorhang@gmail.com>
  • Loading branch information
Banh-Canh committed Oct 4, 2024
1 parent ccde317 commit 68e0815
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 39 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# All pray the NixOS gods !
# All pray the NixOS gods

## 🔍 Description:
## 🔍 Description

<p align=left>

In this project lies the NixOS configuration files leading to our own custom configured NixOS installation.

It has for objective to be flexible with opt-in/opt-out options while still being able to mutualize some of it.

### Wayland with UEFI BOOT only for now !
### Wayland with UEFI BOOT only for now

</p>

## 🚀 Main Features:
## 🚀 Main Features

#### - Reproductibility:
#### - Reproductibility

<p align=left>

Everything as code and reproductible thanks to Nix.

</p>

#### - Modern Zsh shell:
#### - Modern Zsh shell

<p align=left>

A bunch of plugins and GNU cli replacers are pre-installed.

</p>

#### - Profiles:
#### - Profiles

<p align=left>

In this project, it's possible to add Nix code on top the base to customize your way out (git config, opt-in/opt-out for features).

</p>

#### - Easy Install and upgrades:
#### - Easy Install and upgrades

<p align=left>

Expand All @@ -49,9 +49,11 @@ Customization is done via the `profiles` directories.
Install or upgrade with a simple command:

```bash
sudo nixos-rebuild switch -I nixos-config=./profiles/<PROFILE_NAME>/configuration.nix
colmena apply-local --sudo -v switch
```

Profile selected is based on the output of `hostname`.

To upgrade dependencies, run:

```bash
Expand All @@ -60,7 +62,7 @@ npins update

</p>

#### - Screenshot:
#### - Screenshot

with hyprland v2:

Expand Down
8 changes: 4 additions & 4 deletions base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ let
pkgs = import sources.nixpkgs {
config = {
allowUnfree = true;
allowUnfreePredicate = true;
};
};
pkgs-unstable = import sources.nixpkgs-unstable {
config = {
allowUnfree = true;
allowUnfreePredicate = true;
};
};
hostProfile = import ./profiles/${hostname} {
Expand Down Expand Up @@ -96,7 +98,6 @@ in
};
};
networking = {
hostName = "${hostname}"; # Define your hostname.
networkmanager.enable = true;
firewall.enable = false;
};
Expand Down Expand Up @@ -174,9 +175,7 @@ in
polkit.enable = true;
sudo.wheelNeedsPassword = false;
};
nixpkgs = {
inherit pkgs;
};
nixpkgs.config.allowUnfree = true;
nix = {
package = pkgs.lix;
gc = {
Expand Down Expand Up @@ -211,6 +210,7 @@ in
};
environment = {
systemPackages = with pkgs; [
colmena
npins
tailscale
update-systemd-resolved
Expand Down
2 changes: 1 addition & 1 deletion customPkgs/goji.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkgs.buildGoModule rec {

src = gojiSrc;

vendorHash = "sha256-qgFpC559JN+BneAcgrOE7WSXO2cG32+eu8sjk5P5EFI=";
vendorHash = "sha256-nnjMRf7YLwoPbjyZM1HD3iQKe6rqfLvGOJ14eluvLPI=";

subPackages = [ "." ];

Expand Down
2 changes: 1 addition & 1 deletion customPkgs/ytui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkgs.buildGoModule rec {

src = ytuiSrc;

vendorHash = "sha256-/Xit/WU/MB3imK0eR1QSvtjIZz32/rhLMeWD7OxPalQ=";
vendorHash = "sha256-QG2XxFoNU0TQTDfjZ9Bhu0mhcVbz55wh8UppyNfvH/Y=";

subPackages = [ "." ];

Expand Down
28 changes: 28 additions & 0 deletions hive.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
let
sources = import ./npins;
pkgs = import sources.nixpkgs {
config = {
allowUnfree = true;
allowUnfreePredicate = true;
};
};
createConfiguration = parent: {
networking.hostName = parent.hostName;
deployment = {
# Allow local deployment with `colmena apply-local`
allowLocalDeployment = true;

# Disable SSH deployment.
targetHost = null;
};
imports = [ ./profiles/${parent.hostName}/configuration.nix ];
};
in
{
meta = {
nixpkgs = pkgs;
};
totoro = createConfiguration { hostName = "totoro"; };
anya = createConfiguration { hostName = "anya"; };
nishinoya = createConfiguration { hostName = "nishinoya"; };
}
34 changes: 17 additions & 17 deletions npins/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"repo": "goji"
},
"branch": "main",
"revision": "6bb44ccaa71f11d6d6c20e0f8b96a9bb0949fb5f",
"url": "https://github.com/muandane/goji/archive/6bb44ccaa71f11d6d6c20e0f8b96a9bb0949fb5f.tar.gz",
"hash": "13w6cv56c5hm75s12hns11r59as23d5nlwf7ajw3ddnzvr002bh7"
"revision": "944fcb9ef725ee0e4c4004393e4c5e00501252dd",
"url": "https://github.com/muandane/goji/archive/944fcb9ef725ee0e4c4004393e4c5e00501252dd.tar.gz",
"hash": "1nxj7v1hc6r2n3bqm7xm79y7lckhzb5vnag82kan2gvi6nqdgmyv"
},
"home-manager": {
"type": "Git",
Expand All @@ -43,9 +43,9 @@
"url": "https://git.lix.systems/lix-project/lix.git"
},
"branch": "main",
"revision": "aa33c34c9be074c9452976aa96d71091325c83ea",
"revision": "775292766025380d04004e42fefbdb8ca40b3fa3",
"url": null,
"hash": "0l3syyxph52yk6h3501i0pbjvpdql7nrhdfjadqfdv8w4al4zir2"
"hash": "1ak1cayghrrl296v8mr2ykhhnach558p16d666j0hbjnksiq7f3w"
},
"lix-module": {
"type": "Git",
Expand All @@ -54,21 +54,21 @@
"url": "https://git.lix.systems/lix-project/nixos-module.git"
},
"branch": "main",
"revision": "b0e6f359500d66670cc16f521e4f62d6a0a4864e",
"revision": "fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d",
"url": null,
"hash": "12n26gh5h90xpg7nrzgfhcs7hd8nzdswlbnzwlwkcam3rwxwqskg"
"hash": "0jxpqaz12lqibg03iv36sa0shfvamn2yhg937llv3kl4csijd34f"
},
"nixpkgs": {
"type": "Channel",
"name": "nixos-24.05",
"url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.5366.fbca5e745367/nixexprs.tar.xz",
"hash": "0az60wyj4jj1vhvpn5yw04n8x5ldbmh5sk39321357bybz4pal9h"
"url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.5438.5966581aa04b/nixexprs.tar.xz",
"hash": "1s9rqd7i9yxx3y9mm3if10pj46ak09ygflbbm3cvw96vys2jxjaq"
},
"nixpkgs-unstable": {
"type": "Channel",
"name": "nixos-unstable",
"url": "https://releases.nixos.org/nixos/unstable/nixos-24.11pre685764.1925c603f17f/nixexprs.tar.xz",
"hash": "0xsbahnvb8klvrzsg9xmf4r18y2d2mmqvcvaw0asarigp9y1hg0m"
"url": "https://releases.nixos.org/nixos/unstable/nixos-24.11pre687768.27e30d177e57/nixexprs.tar.xz",
"hash": "17m6gfb9bwhdl679f1s2ish4j14q8m8c05c8gvzh7i5hcki51s1l"
},
"nixvim": {
"type": "Git",
Expand Down Expand Up @@ -102,9 +102,9 @@
"repo": "spicetify-nix"
},
"branch": "master",
"revision": "cf34817877db467a9c881ffa1de3d2822fdc137a",
"url": "https://github.com/Gerg-L/spicetify-nix/archive/cf34817877db467a9c881ffa1de3d2822fdc137a.tar.gz",
"hash": "1l2da1c7pd6lyni5whhvsvnmby3kxzs0ib7mjkqffhig0hpzgpjr"
"revision": "829a81049fb019d12be8daf867c03de2ee52d49f",
"url": "https://github.com/Gerg-L/spicetify-nix/archive/829a81049fb019d12be8daf867c03de2ee52d49f.tar.gz",
"hash": "18sly5ckppmbixx2cwmlr5ci1bi0lp33p21l5g9py696kdwsxqbf"
},
"stylix": {
"type": "Git",
Expand All @@ -126,9 +126,9 @@
"repo": "ytui"
},
"branch": "main",
"revision": "8b0f3f46564ea4a071ca8a8e2707303260edde71",
"url": "https://github.com/banh-canh/ytui/archive/8b0f3f46564ea4a071ca8a8e2707303260edde71.tar.gz",
"hash": "0llrqln5fpdrv2dymj53y9wjs8wyzqr1jddspwn5pig2s48y3pix"
"revision": "d8bc2d500a1cbd80ea3f87fbab9cd8d190a76839",
"url": "https://github.com/banh-canh/ytui/archive/d8bc2d500a1cbd80ea3f87fbab9cd8d190a76839.tar.gz",
"hash": "0l6q1jx3a841fcvv3794zs396z4c2pjmr29fmcf8wza662db7b71"
}
},
"version": 3
Expand Down
7 changes: 5 additions & 2 deletions profiles/anya/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
args@{ ... }:
args:
let
# Get the current directory's name
currentDir = builtins.toString ./.;
hostname = builtins.baseNameOf currentDir;
# Import the base configuration with the dynamic hostname
base = import ../../base.nix (args // { inherit hostname; });
hostname = "anya";
in
base
7 changes: 5 additions & 2 deletions profiles/nishinoya/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
args@{ ... }:
args:
let
# Get the current directory's name
currentDir = builtins.toString ./.;
hostname = builtins.baseNameOf currentDir;
# Import the base configuration with the dynamic hostname
base = import ../../base.nix (args // { inherit hostname; });
hostname = "nishinoya";
in
base
7 changes: 5 additions & 2 deletions profiles/totoro/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
args@{ ... }:
args:
let
# Get the current directory's name
currentDir = builtins.toString ./.;
hostname = builtins.baseNameOf currentDir;
# Import the base configuration with the dynamic hostname
base = import ../../base.nix (args // { inherit hostname; });
hostname = "totoro";
in
base

0 comments on commit 68e0815

Please sign in to comment.