Archived
Watch
1
0
Fork
You've already forked nixos
0

flake revamp

This commit is contained in:
asnev 2026-07-11 11:53:41 +07:00
commit 435628dc4a
Signed by: asnev
SSH key fingerprint: SHA256:8hagYq9hDUuS5clQ78FKhIoQDvg5crdkYMHX+3g7wB4
7 changed files with 106 additions and 126 deletions

View file

@ -4,10 +4,8 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager.url = "github:nix-community/home-manager/release-26.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
@ -16,41 +14,22 @@
nixpkgs-unstable,
home-manager,
...
}: let
system = "x86_64-linux";
in {
nixosConfigurations = {
phostron = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
({
config,
pkgs,
...
}: {
nixpkgs = {
hostPlatform = system;
config.allowUnfree = true;
overlays = [
(final: prev: {
unstable = import nixpkgs-unstable {
system = prev.stdenv.hostPlatform.system;
config.allowUnfree = true;
};
})
];
};
})
./hosts/phostron/configuration.nix
];
};
};
homeConfigurations.coyote = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {inherit inputs;};
}: {
nixosConfigurations.phostron = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
./users/coyote/home.nix
./nixos/configuration.nix
./hosts/phostron/configuration.nix
./profiles/desktops/kde.nix
./users/coyote/configuration.nix
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit inputs;};
users.coyote.imports = [./users/coyote/home.nix];
};
}
];
};
};

View file

@ -1,12 +1,8 @@
{...}: {
imports = [
./hardware-configuration.nix
../../configuration.nix
../../profiles/kde.nix
../../users/coyote/configuration.nix
];
imports = [./hardware-configuration.nix];
system.stateVersion = "26.05"; # I hope you know what you're doing. :)
nixpkgs.hostPlatform = "x86_64-linux";
services.displayManager.sddm.settings = {
Theme = {

170
nixos/configuration.nix Normal file
View file

@ -0,0 +1,170 @@
{
config,
lib,
pkgs,
inputs,
...}: {
boot = {
loader.systemd-boot = {
enable = true;
configurationLimit = 10;
efi.canTouchEfiVariables = true;
};
timeout = 2;
kernelParams = [
"quiet"
"rd.udev.log_level=3"
"rd.systemd.show_status=auto"
];
initrd.verbose = false;
consoleLogLevel = 3;
kernelPackages = pkgs.linuxPackages;
};
time.timeZone = "Asia/Jakarta";
i18n.defaultLocale = "en_GB.UTF-8";
services = {
fwupd.enable = true;
xserver.xkb.layout = "us";
locate.enable = true;
printing.enable = true;
openssh.enable = false;
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
};
security.rtkit.enable = true;
nix.settings = {
experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true;
};
nixpkgs = {
config.allowUnfree = true;
overlays = [
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = prev.stdenv.hostPlatform.system;
config.allowUnfree = true;
};
})
];
};
environment = {
systemPackages = with pkgs; [
# Nix
nh
alejandra
# system devel
python3
gcc
clang
# system utils
firmware-updater
mtr
gnupg
ddate
testdisk
tree
wget
btop
dysk
plocate
traceroute
rlwrap
entr
unzip
ffmpeg
imagemagick
# extra utils
fd
bat
xh
tlrc
dust
hyperfine
ripgrep
fzf
eza
];
shellAliases = {
l = "eza --long --all";
ll = "eza --long";
ls = "eza --long";
};
};
programs = {
fish.enable = true;
starship.enable = true;
atuin = {
enable = true;
settings.sync_address = "https://api.atuin.sh";
};
nix-ld = {
enable = true;
libraries = with pkgs; [
fuse
e2fsprogs
];
};
tmux = {
enable = true;
clock24 = true;
baseIndex = 1;
shortcut = "a";
keyMode = "vi";
terminal = "screen-256color";
escapeTime = 0;
extraConfig = ''
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
set-option -g status-right "\"#W\""
set -ga terminal-overrides ",*:RGB"
set -g mouse on
set -g set-clipboard on
'';
};
};
fonts = {
packages = with pkgs; [
# GUI fonts
inter
corefonts
vista-fonts
roboto
cantarell-fonts
# fonts for i18n
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
noto-fonts-monochrome-emoji
unifont
unifont_upper
unifont-csur
# terminal fonts
nerd-fonts.iosevka
];
fontconfig = {
antialias = true;
subpixel.rgba = "rgb";
};
};
xdg.portal = {
enable = true;
config.common.default = ["gtk"];
extraPortals = with pkgs; [xdg-desktop-portal-wlr];
};
}

8
nixos/nixpkgs.nix Normal file
View file

@ -0,0 +1,8 @@
{
config,
lib,
pkgs,
inputs,
...
}: {
}

20
profiles/desktops/kde.nix Normal file
View file

@ -0,0 +1,20 @@
{pkgs, ...}: {
services = {
displayManager.sddm.enable = true;
desktopManager.plasma6.enable = true;
};
environment = {
systemPackages = with pkgs.kdePackages; [
kate
bluez-qt
kalk
filelight
kamoso
konversation
kmail
ktorrent
];
plasma6.excludePackages = with pkgs.kdePackages; [discover];
};
}

View file

@ -16,65 +16,7 @@ in {
defaultUserShell = pkgs.unstable.fish;
};
environment = {
systemPackages = with pkgs; [
# utils
ghostscript
tectonic
# lisps
chicken
guile
sbcl
unstable.racket
# devel
ast-grep
nodejs
lua
luarocks
stylua
mermaid-cli
unstable.lazygit
# LSPs
ty
nil
marksman
systemd-lsp
bash-language-server
];
sessionVariables.SSH_AUTH_SOCK = "/run/user/${builtins.toString USER_ID}/ssh-agent";
};
programs = {
starship = {
package = pkgs.unstable.starship;
transientPrompt.enable = true;
transientPrompt.left = "starship module character";
settings = {
"$schema" = "https://starship.rs/config-schema.json";
"git_status" = {
ahead = ">";
behind = "<";
diverged = "<>";
renamed = "r";
deleted = "x";
};
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
};
};
ssh.startAgent = true;
obs-studio = {
enable = true;
enableVirtualCamera = true;
plugins = with pkgs.obs-studio-plugins; [
input-overlay
droidcam-obs
wlrobs
];
};
};
environment.sessionVariables.SSH_AUTH_SOCK = "/run/user/${builtins.toString USER_ID}/ssh-agent";
systemd.user.services.ssh-add-key = {
wantedBy = ["default.target"];
@ -89,4 +31,11 @@ in {
RestartSec = 1;
};
};
programs = {
obs-studio.enableVirtualCamera = true;
ssh.startAgent = true;
starship.transientPrompt.enable = true;
starship.transientPrompt.left = "starship module character";
};
}

View file

@ -1,12 +1,12 @@
{pkgs, ...}: let
programsDir = ./programs;
programsImports = map (name: programsDir + "/${name}") (
builtins.filter
(name: builtins.match ".*\\.nix" name != null)
(builtins.attrNames (builtins.readDir programsDir))
);
in {
imports = programsImports;
{pkgs, ...}: {
imports = let
programsDir = ./programs;
programsImports = map (name: programsDir + "/${name}") (
builtins.filter
(name: builtins.match ".*\\.nix" name != null)
(builtins.attrNames (builtins.readDir programsDir))
);
in programsImports;
home = {
stateVersion = "26.05"; # I hope you know what you're doing. :)
@ -36,6 +36,13 @@ in {
osu-lazer-bin
# emulation
(unstable.bottles.override {removeWarningPopup = true;})
# lisps
chicken
guile
sbcl
unstable.racket
# devel
unstable.lazygit
];
};
@ -65,5 +72,30 @@ in {
enable = true;
package = pkgs.unstable.yt-dlp;
};
starship = {
package = pkgs.unstable.starship;
settings = {
"$schema" = "https://starship.rs/config-schema.json";
"git_status" = {
ahead = ">";
behind = "<";
diverged = "<>";
renamed = "r";
deleted = "x";
};
character = {
success_symbol = "[λ](bold green)";
error_symbol = "[λ](bold red)";
};
};
};
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
input-overlay
droidcam-obs
wlrobs
];
};
};
}