Compare commits

...

4 Commits

Author SHA1 Message Date
m3tam3re
be308cb16a -repl-flakes, fix:homeConfiguration module 2024-11-25 09:37:21 +01:00
m3tam3re
1f6e2b3a64 video3 2024-09-03 18:01:56 +02:00
m3tam3re
d20945d5f3 host-rename 2024-09-03 16:07:03 +02:00
m3tam3re
6a18670749 video2 2024-08-28 16:16:23 +02:00
12 changed files with 147 additions and 23 deletions

8
flake.lock generated
View File

@ -38,16 +38,16 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1711668574,
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
"lastModified": 1724531977,
"narHash": "sha256-XROVLf9ti4rrNCFLr+DmXRZtPjCQTW4cYy59owTEmxk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
"rev": "2527da1ef492c495d5391f3bcf9c1dd9f4514e32",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}

View File

@ -39,16 +39,16 @@
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
overlays = import ./overlays {inherit inputs;};
nixosConfigurations = {
m3-kratos = nixpkgs.lib.nixosSystem {
m3-kratos-vm = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [./hosts/m3-kratos];
};
};
homeConfigurations = {
"m3tam3re@m3tam3re" = home-manager.lib.homeManagerConfiguration {
"m3tam3re@m3-kratos-vm" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home/m3tam3re/m3tam3re.nix];
modules = [./home/m3tam3re/m3-kratos.nix];
};
};
};

View File

@ -1,4 +1,10 @@
{ config, lib, outputs, pkgs, ... }: {
{
config,
lib,
outputs,
pkgs,
...
}: {
nixpkgs = {
# You can add overlays here
overlays = [
@ -29,7 +35,7 @@
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
experimental-features = ["nix-command" "flakes"];
warn-dirty = false;
};
};

View File

@ -0,0 +1,31 @@
{pkgs, ...}: {
imports = [
./fish.nix
];
programs.zoxide = {
enable = true;
enableFishIntegration = true;
};
programs.eza = {
enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
extraOptions = ["-l" "--icons" "--git" "-a"];
};
programs.bat = {enable = true;};
home.packages = with pkgs; [
coreutils
fd
htop
httpie
jq
procs
ripgrep
tldr
zip
];
}

View File

@ -0,0 +1,32 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.features.cli.fish;
in {
options.features.cli.fish.enable = mkEnableOption "enable extended fish configuration";
config = mkIf cfg.enable {
programs.fish = {
enable = true;
loginShellInit = ''
set -x NIX_PATH nixpkgs=channel:nixos-unstable
set -x NIX_LOG info
set -x TERMINAL kitty
if test (tty) = "/dev/tty1"
exec Hyprland &> /dev/null
end
'';
shellAbbrs = {
".." = "cd ..";
"..." = "cd ../..";
ls = "eza";
grep = "rg";
ps = "procs";
};
};
};
}

View File

@ -1,10 +1,12 @@
# This is a default home.nix generated by the follwing hone-manager command
#
#
# home-manager init ./
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = lib.mkDefault "your-name";
@ -21,7 +23,9 @@
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
home.packages = with pkgs; [
kitty
wofi
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello

View File

@ -1 +1,13 @@
{ config, ... }: { imports = [ ./home.nix ../common ]; }
{config, ...}: {
imports = [
../common
../features/cli
./home.nix
];
features = {
cli = {
fish.enable = false;
};
};
}

View File

@ -1,10 +1,19 @@
# Common configuration for all hosts
{
pkgs,
lib,
inputs,
outputs,
...
}: {
imports = [
./users
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
useUserPackages = true;
extraSpecialArgs = {inherit inputs outputs;};
};
nixpkgs = {
# You can add overlays here
overlays = [
@ -48,4 +57,5 @@
((lib.filterAttrs (_: lib.isType "flake")) inputs);
nixPath = ["/etc/nix/path"];
};
users.defaultUserShell = pkgs.fish;
}

View File

@ -0,0 +1,3 @@
{
imports = [./m3tam3re.nix];
}

1
hosts/common/users/m3tam3re Symbolic link
View File

@ -0,0 +1 @@
../../../home/m3tam3re

View File

@ -0,0 +1,30 @@
{
config,
pkgs,
inputs,
...
}: {
users.users.m3tam3re = {
initialHashedPassword = "$y$j9T$IoChbWGYRh.rKfmm0G86X0$bYgsWqDRkvX.EBzJTX.Z0RsTlwspADpvEF3QErNyCMC";
isNormalUser = true;
description = "m3tam3re";
extraGroups = [
"wheel"
"networkmanager"
"libvirtd"
"flatpak"
"audio"
"video"
"plugdev"
"input"
"kvm"
"qemu-libvirtd"
];
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3YEmpYbM+cpmyD10tzNRHEn526Z3LJOzYpWEKdJg8DaYyPbDn9iyVX30Nja2SrW4Wadws0Y8DW+Urs25/wVB6mKl7jgPJVkMi5hfobu3XAz8gwSdjDzRSWJrhjynuaXiTtRYED2INbvjLuxx3X8coNwMw58OuUuw5kNJp5aS2qFmHEYQErQsGT4MNqESe3jvTP27Z5pSneBj45LmGK+RcaSnJe7hG+KRtjuhjI7RdzMeDCX73SfUsal+rHeuEw/mmjYmiIItXhFTDn8ZvVwpBKv7xsJG90DkaX2vaTk0wgJdMnpVIuIRBa4EkmMWOQ3bMLGkLQeK/4FUkNcvQ/4+zcZsg4cY9Q7Fj55DD41hAUdF6SYODtn5qMPsTCnJz44glHt/oseKXMSd556NIw2HOvihbJW7Rwl4OEjGaO/dF4nUw4c9tHWmMn9dLslAVpUuZOb7ykgP0jk79ldT3Dv+2Hj0CdAWT2cJAdFX58KQ9jUPT3tBnObSF1lGMI7t77VU= m3tam3re@m3-nix"
];
packages = [inputs.home-manager.packages.${pkgs.system}.default];
};
home-manager.users.m3tam3re =
import ../../../home/m3tam3re/${config.networking.hostName}.nix;
}

View File

@ -46,14 +46,6 @@
variant = "";
};
# Define a user account. Don't forget to set a password with passwd.
users.users.m3tam3re = {
isNormalUser = true;
description = "m3tam3re";
extraGroups = ["networkmanager" "wheel"];
packages = with pkgs; [];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@ -87,6 +79,9 @@
enable = true;
xwayland.enable = true;
};
programs.fish.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];