Looooots of changes..

This commit is contained in:
CherryKitten 2024-03-24 19:02:27 +01:00
parent 07a07ab45e
commit 7fd8e6c7c4
Signed by: sammy
GPG key ID: 98D8F75FB0658276
11 changed files with 90 additions and 73 deletions

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1702676849, "lastModified": 1706981411,
"narHash": "sha256-XqcREaTS38/QOsN8fk8PP325/UXHyF9enbP5ZPw5aiA=", "narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "aa99c2f4e9847cbb7e46fac0844ea1eb164b3b3a", "rev": "652fda4ca6dafeb090943422c34ae9145787af37",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701952659, "lastModified": 1709309926,
"narHash": "sha256-TJv2srXt6fYPUjxgLAL0cy4nuf1OZD4KuA1TrCiQqg0=", "narHash": "sha256-VZFBtXGVD9LWTecGi6eXrE0hJ/mVB3zGUlHImUs2Qak=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b4372c4924d9182034066c823df76d6eaf1f4ec4", "rev": "79baff8812a0d68e24a836df0a364c678089e2c7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -38,11 +38,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1702206697, "lastModified": 1709356872,
"narHash": "sha256-vE9oEx3Y8TO5MnWwFlmopjHd1JoEBno+EhsfUCq5iR8=", "narHash": "sha256-mvxCirJbtkP0cZ6ABdwcgTk0u3bgLoIoEFIoYBvD6+4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "29d6c96900b9b576c2fb89491452f283aa979819", "rev": "458b097d81f90275b3fdf03796f0563844926708",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -15,53 +15,46 @@
, home-manager , home-manager
, ... , ...
}: }:
let
mkHost = { hostname, user ? "sammy" }: {
imports = [
./hosts/${hostname}/configuration.nix
./modules
(import "${home-manager}/nixos")
];
deployment = {
targetUser = user;
allowLocalDeployment = true;
};
};
in
{ {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
colmena = { colmena = {
meta = { meta = {
description = "All my NixoS machines";
specialArgs = {
flake = self;
};
nixpkgs = import nixpkgs { nixpkgs = import nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
overlays = [ ]; overlays = [ ];
}; };
}; };
bengal = bengal = mkHost { hostname = "bengal"; };
{ name
, nodes
, pkgs
, ...
}: {
imports = [
./hosts/${name}/configuration.nix
./modules/common
(import "${home-manager}/nixos")
];
deployment = { maine-coon = mkHost { hostname = "maine-coon"; };
targetUser = "sammy";
allowLocalDeployment = true;
};
};
maine-coon =
{ name
, nodes
, pkgs
, ...
}: {
imports = [
./hosts/${name}/configuration.nix
./modules/common
(import "${home-manager}/nixos")
];
deployment = {
targetHost = "maine-coon";
allowLocalDeployment = true;
};
};
}; };
nixosConfigurations.test = nixpkgs.lib.nixosSystem { nixosConfigurations.test = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
flake = self;
};
modules = [ modules = [
./modules
./hosts/test-vm/configuration.nix ./hosts/test-vm/configuration.nix
(import "${home-manager}/nixos") (import "${home-manager}/nixos")
]; ];

View file

@ -4,13 +4,6 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [
../../modules/common
../../modules/graphical
];
cherrykitten.graphical.enable = false;
users.users.admin = { users.users.admin = {
isNormalUser = true; isNormalUser = true;
extraGroups = ["wheel"]; extraGroups = ["wheel"];

View file

@ -6,13 +6,6 @@
}: let }: let
cfg = config.cherrykitten.common; cfg = config.cherrykitten.common;
in { in {
imports = [
./users.nix
./security.nix
./yubikey.nix
../graphical
];
options.cherrykitten.common = { options.cherrykitten.common = {
test = lib.mkOption { test = lib.mkOption {
type = lib.types.str; type = lib.types.str;

24
modules/default.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs, config, lib, ... }:
let
cfg = config.cherrykitten;
in
with lib;
{
imports = [
./common.nix
./graphical.nix
./security.nix
./users.nix
./yubikey.nix
./nvim
./shell/fish.nix
];
options.cherrykitten = { };
config = {
cherrykitten.fish.enable = mkDefault true;
cherrykitten.graphical.enable = mkDefault false;
};
}

View file

@ -4,7 +4,7 @@
inputs, inputs,
... ...
}: { }: {
programs.neovim = let home-manager.users.sammy.programs.neovim = let
toLua = str: "lua << EOF\n${str}\nEOF\n"; toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n"; toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in { in {

30
modules/shell/fish.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs, config, lib, flake, ... }:
let
cfg = config.cherrykitten.fish;
in
with lib;
{
options.cherrykitten.fish.enable = mkEnableOption "Fish-Shell";
config = mkIf cfg.enable {
home-manager.users.sammy = {
programs.fish = {
enable = true;
};
home.file = {
fish_prompt = {
source = flake + files/config/fish/functions/fish_prompt.fish;
target = ".config/fish/functions/fish_prompt.fish";
};
fish_right_prompt = {
source = flake + files/config/fish/functions/fish_right_prompt.fish;
target = ".config/fish/functions/fish_right_prompt.fish";
};
};
};
};
}

View file

@ -22,7 +22,6 @@ in
}; };
home-manager.users.sammy = { home-manager.users.sammy = {
imports = [ ../nvim ];
home.username = "sammy"; home.username = "sammy";
home.homeDirectory = "/home/sammy"; home.homeDirectory = "/home/sammy";
home.stateVersion = "23.11"; # Please read the comment before changing. home.stateVersion = "23.11"; # Please read the comment before changing.
@ -50,21 +49,6 @@ in
}; };
}; };
fish = {
enable = true;
functions = { };
};
};
home.file = {
fish_prompt = {
source = ../../files/config/fish/functions/fish_prompt.fish;
target = ".config/fish/functions/fish_prompt.fish";
};
fish_right_prompt = {
source = ../../files/config/fish/functions/fish_right_prompt.fish;
target = ".config/fish/functions/fish_right_prompt.fish";
};
}; };
home.sessionVariables = { home.sessionVariables = {