disko + some stuff ported from arch

This commit is contained in:
twoneis 2024-05-25 01:41:30 +02:00
parent 1f8cd27be2
commit c2e1d5b4e4
10 changed files with 178 additions and 56 deletions

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./hardware-config.nix ./hardware-config.nix
./options.nix ./options.nix
./disko.nix
]; ];
networking.hostName = "akarso"; networking.hostName = "akarso";
@ -12,6 +13,7 @@
systemd-boot = { systemd-boot = {
enable = true; enable = true;
}; };
efi.canTouchEfiVariables = true;
}; };
hardware.opengl = { hardware.opengl = {

60
devices/akarso/disko.nix Normal file
View file

@ -0,0 +1,60 @@
{ ... }: {
disko.devices = {
disk = {
vdb = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" "noatime" ];
};
};
swap = {
swapfile = {
size = "8G";
};
};
};
};
};
};
};
};
};
};
}

View file

@ -8,23 +8,6 @@
extraModulePackages = [ ]; extraModulePackages = [ ];
}; };
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/4ecc3b27-016f-4416-a819-bd0998fc993f";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/0721-3632";
fsType = "vfat";
};
"/ext" = {
device = "/dev/disk/by-uuid/b3faf000-8792-4fca-916a-5965c0cb8186";
fsType = "ext4";
};
};
swapDevices = [ { device = "/dev/disk/by-uuid/b35abec3-ff20-4b3b-b953-e36f2df719cb"; } ];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View file

@ -4,6 +4,11 @@
url = "github:nixos/nixpkgs/nixos-unstable"; url = "github:nixos/nixpkgs/nixos-unstable";
}; };
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View file

@ -87,16 +87,6 @@
}; };
}; };
services.xserver = {
enable = true;
excludePackages = [ pkgs.xterm ];
displayManager.gdm.enable = true;
xkb = {
layout = "us";
variant = "";
};
};
# Needed for some features in nautilus such as auto-mounting and trash # Needed for some features in nautilus such as auto-mounting and trash
services.gvfs.enable = true; services.gvfs.enable = true;
@ -110,8 +100,8 @@
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
}; };
programs.zsh.enable = true; programs.fish.enable = true;
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.fish;
security.pam.services.swaylock = {}; security.pam.services.swaylock = {};
} }

View file

@ -23,26 +23,72 @@ in lib.mkIf (osConfig.withNiri) {
layer = "top"; layer = "top";
position = "top"; position = "top";
modules-left = [ modules-left = [
"network" "memory"
"cpu"
]; ];
modules-center = [ modules-center = [
"clock" "clock"
]; ];
modules-right = [ modules-right = [
"network"
"wireplumber" "wireplumber"
"battery" "battery"
]; ];
"cpu" = {
interval = 10;
format = "{usage}% ";
};
"memory" = {
interval = 30;
format = "{percentage}% ";
};
"clock" = {
format = "{:%H:%M}";
format-alt = "{:%a, %Y-%m-%d}";
};
"battery" = {
states = {
good = 80;
warning = 50;
critical = 20;
};
format = "{icon}";
format-alt = "{capacity}%";
format-icons = ["" "" "" "" ""];
tooltip = false;
};
"network" = {
format-wifi = "{icon}";
format-alt = "{essid}";
format-ethernet = "󰈁";
format-disconnected = "󰤭";
format-icons = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"];
tooltip = false;
};
"wireplumber" = {
format = "{icon}";
format-alt = "{volume}%";
format-muted = "";
format-icons = ["" "" ""];
tooltip = false;
}; };
}; };
# style = import ./waybar-style.nix; };
style = builtins.readFile(./waybar.css);
}; };
services.mako = { services.mako = {
enable = true; enable = true;
defaultTimeout = 5; defaultTimeout = 5000;
maxHistory = 20;
maxVisible = 3;
font = "AlegreyaSans";
backgroundColor = theme.base.hex; backgroundColor = theme.base.hex;
borderColor = theme.muted.hex; borderColor = theme.muted.hex;
textColor = theme.text.hex; textColor = theme.text.hex;
borderSize = 1;
borderRadius = 8;
icons = false;
}; };
programs.swaylock = { programs.swaylock = {

View file

@ -0,0 +1,45 @@
* {
border: none;
font-family: FiraCodeNerdFont;
font-size: 13px;
color: #191724;
border-radius: 20px;
}
window#waybar {
background: rgba(0, 0, 0, 0);
}
/*-----module groups----*/
.modules-right {
background-color: #c4a7e7;
margin: 2px 10px 0 0;
}
.modules-center {
background-color: #c4a7e7;
margin: 2px 0 0 0;
}
.modules-left {
margin: 2px 0 0 10px;
background-color: #c4a7e7;
}
#clock,
#battery,
#cpu,
#memory,
#network,
#wireplumber {
padding: 0 15px;
}
/*-----Indicators----*/
#battery.charging {
color: #31748f;
}
#battery.warning:not(.charging) {
color: #eb6f92;
}
#battery.critical:not(.charging) {
color: #eb6f92;
}

View file

@ -108,16 +108,8 @@
# For direnv and shell aliases the shell needs to be managed by hm # For direnv and shell aliases the shell needs to be managed by hm
programs.bash.enable = true; programs.bash.enable = true;
programs.zsh = { programs.fish = {
enable = true; enable = true;
autosuggestion.enable = true; plugins = with pkgs.fishPlugins; [ pure ];
enableVteIntegration = true;
history.ignoreAllDups = true;
historySubstringSearch.enable = true;
oh-my-zsh = {
enable = true;
plugins = [ "git" "thefuck" ];
theme = "bira";
};
}; };
} }

View file

@ -2,12 +2,8 @@
programs.niri.enable = true; programs.niri.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
brightnessctl brightnessctl
swaybg
pamixer
xwayland
i3
rofi
]; ];
home-manager.users.twoneis = { home-manager.users.twoneis = {
programs.niri = { programs.niri = {
settings = { settings = {
@ -36,7 +32,7 @@
}; };
position = { position = {
x=0; x=0;
y=1200; y=0;
}; };
}; };
@ -48,7 +44,7 @@
refresh = 59.940; refresh = 59.940;
}; };
position = { position = {
x=0; x=2736;
y=0; y=0;
}; };
}; };
@ -74,6 +70,11 @@
gaps = 4; gaps = 4;
}; };
window-rule = {
geometry-corner-radius = 8;
clip-to-geometry = true;
};
prefer-no-csd = true; prefer-no-csd = true;
screenshot-path = "~/Pictures/Screenshots/%Y-%m-%d-%H-%M-%S.png"; screenshot-path = "~/Pictures/Screenshots/%Y-%m-%d-%H-%M-%S.png";
@ -82,20 +83,17 @@
spawn-at-startup = [ spawn-at-startup = [
{ command = ["waybar"]; } { command = ["waybar"]; }
{ command = ["swaybg" "-i" "${../../wallpaper/wallpaper.png}" "-m" "fill"]; } { command = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0"]; }
{ command = ["pamixer" "--set-volume" "0"]; }
{ command = ["brightnessctl" "s" "50%"]; } { command = ["brightnessctl" "s" "50%"]; }
{ command = ["systemctl" "--user" "restart" "spotifyd.service"]; }
]; ];
binds = { binds = {
"Mod+T".action.spawn = "alacritty"; "Mod+T".action.spawn = "alacritty";
"Mod+B".action.spawn = "firefox"; "Mod+B".action.spawn = "firefox";
"Mod+S".action.spawn = ["fuzzel" "-I" "-T" "alacritty" "-p" ""]; "Mod+S".action.spawn = ["fuzzel" "-I" "-T" "alacritty" "-p" ""];
"Mod+X".action.spawn = ["sh" "-c" "Xwayland & env DISPLAY=:0 i3"];
"XF86AudioRaiseVolume".action.spawn = ["pamixer" "-i" "5"]; "XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "-l" "1" "@DEFAULT_AUDIO_SINK@" "5%+"];
"XF86AudioLowerVolume".action.spawn = ["pamixer" "-d" "5"]; "XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
"XF86MonBrightnessDown".action.spawn = ["brightnessctl" "-n=10%" "s" "5%-"]; "XF86MonBrightnessDown".action.spawn = ["brightnessctl" "-n=10%" "s" "5%-"];
"XF86MonBrightnessUp".action.spawn = ["brightnessctl" "s" "5%+"]; "XF86MonBrightnessUp".action.spawn = ["brightnessctl" "s" "5%+"];

View file

@ -1,4 +1,4 @@
{ nixpkgs, home-manager, nixos-hardware, niri, ... }@inputs: { { nixpkgs, disko, home-manager, nixos-hardware, niri, ... }@inputs: {
nixosConfigurations = { nixosConfigurations = {
# AMD Ryzen 5600X # AMD Ryzen 5600X
# nvidia GeForce GTX 1060 (6GB) # nvidia GeForce GTX 1060 (6GB)
@ -26,6 +26,7 @@
./devices/akarso ./devices/akarso
./modules ./modules
./options.nix ./options.nix
disko.nixosModules.disko
nixos-hardware.nixosModules.microsoft-surface-pro-intel nixos-hardware.nixosModules.microsoft-surface-pro-intel
niri.nixosModules.niri niri.nixosModules.niri
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager