1
0

Compare commits

..

1 Commits

Author SHA1 Message Date
blueplum 9580f18b53 awdawdawd 2026-03-10 17:36:37 +01:00
36 changed files with 788 additions and 1479 deletions
+20 -40
View File
@@ -1,39 +1,12 @@
let
concat = strings: builtins.concatStringsSep " " strings;
displays =
let
primary = "DP-2";
secondary = "HDMI-0";
in
{ {
inherit primary secondary;
xrandr = concat [
"--output ${primary}"
"--mode 1920x1080"
"--pos 0x0"
"--rate 144"
"--primary"
""
"--output ${secondary}"
"--mode 1920x1080"
"--pos 1920x0"
"--rate 144"
];
};
in
{
inherit displays;
nixosModule =
{
pkgs,
config, config,
pkgs,
lib ? pkgs.lib, lib ? pkgs.lib,
... ...
}: }:
let let
concat = strings: builtins.concatStringsSep " " strings;
wacom.src = wacom.src =
let let
xsetwacom = "${pkgs.xf86_input_wacom}/bin/xsetwacom"; xsetwacom = "${pkgs.xf86_input_wacom}/bin/xsetwacom";
@@ -69,10 +42,8 @@ in
${xsetwacom} set "$stylus" MapToOutput HEAD-0 ${xsetwacom} set "$stylus" MapToOutput HEAD-0
''; '';
in in
{ {
services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.wacom.enable = true; services.xserver.wacom.enable = true;
@@ -86,6 +57,23 @@ in
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
}; };
home-manager.users.anton.xsession.profileExtra = concat [
"${lib.getExe pkgs.xrandr}"
"${concat [
"--output DP-2"
"--mode 1920x1080"
"--pos 0x0"
"--rate 144"
"--primary"
]}"
"${concat [
"--output HDMI-0"
"--mode 1920x1080"
"--pos 1920x0"
"--rate 144"
]}"
];
systemd.user.services.wacom = { systemd.user.services.wacom = {
enable = true; enable = true;
description = "Configure my Wacom (One) tablet"; description = "Configure my Wacom (One) tablet";
@@ -100,12 +88,4 @@ in
services.udev.extraRules = '' services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="056a", TAG+="systemd", ENV{SYSTEMD_USER_WANTS}+="wacom.service" ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="056a", TAG+="systemd", ENV{SYSTEMD_USER_WANTS}+="wacom.service"
''; '';
};
homeManager = {
programs.git.signing = {
signByDefault = true;
key = "60649DFDEAACD73D";
};
};
} }
+66 -30
View File
@@ -2,20 +2,36 @@
config, config,
pkgs, pkgs,
lib, lib,
hostname,
env,
... ...
}: }:
let
stateVersion = "25.05";
env = import ./.env.nix { inherit pkgs; };
mpkgs = import ./pkgs/default.nix {
config = {
system.stateVersion = stateVersion;
};
};
in
{ {
imports = [ ./hardware-configuration.nix ] ++ lib.optional (env ? nixosModule) env.nixosModule; imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
# (import (./. + "/${env.hostname}.nix"))
# mpkgs.home-manager.module
];
nix.settings.experimental-features = [ nix.settings.experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
nixpkgs.config.allowUnfree = true;
# nixpkgs.config.allowUnfree = true;
# nixpkgs.overlays = [
# (import "${fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz"}/overlay.nix")
# ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
chromium chromium
@@ -32,10 +48,17 @@
fzf fzf
ripgrep ripgrep
# perhaps set up lsps through dev shells someday? (fenix.stable.withComponents [
"rustc"
"cargo"
"clippy"
"rust-src"
"rustfmt"
"rust-analyzer"
])
nodejs_latest nodejs_latest
typescript-language-server
prettierd prettierd
typescript-language-server
pnpm pnpm
nixd nixd
nixfmt nixfmt
@@ -52,8 +75,8 @@
jetbrains-mono jetbrains-mono
nerd-fonts.symbols-only nerd-fonts.symbols-only
inter inter
nimbus-roman times-newer-roman
monaco (mpkgs.font.monaco)
]; ];
fonts.fontconfig = { fonts.fontconfig = {
@@ -69,7 +92,7 @@
"Inter" "Inter"
"Noto Sans" "Noto Sans"
]; ];
serif = [ "Nimbus Roman" ]; serif = [ "Times Newer Roman" ];
}; };
}; };
@@ -79,13 +102,16 @@
windowManager.i3 = { windowManager.i3 = {
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
rofi rofi
i3status i3status
]; ];
}; };
displayManager.startx.enable = true; displayManager.startx.enable = true;
# Configure keymap in X11
xkb = { xkb = {
layout = "us"; layout = "us";
variant = ""; variant = "";
@@ -97,7 +123,8 @@
greetd = { greetd = {
enable = true; enable = true;
restart = false; restart = false;
settings.default_session = { settings = {
default_session = {
command = lib.concatStringsSep " " [ command = lib.concatStringsSep " " [
"${lib.getExe pkgs.tuigreet}" "${lib.getExe pkgs.tuigreet}"
"--remember" "--remember"
@@ -108,6 +135,7 @@
}; };
}; };
}; };
};
programs.chromium = import ./home/chromium.nix; programs.chromium = import ./home/chromium.nix;
@@ -130,6 +158,14 @@
]; ];
}; };
# home-manager = {
# useUserPackages = true;
# useGlobalPkgs = true;
# sharedModules = [ ] ++ (mpkgs.home-manager.sharedModules);
# users.anton = import ./home.nix;
# };
# programs.home-manager.enable = true;
programs.dconf.enable = true; programs.dconf.enable = true;
qt = { qt = {
enable = true; enable = true;
@@ -137,25 +173,26 @@
style = "adwaita-dark"; style = "adwaita-dark";
}; };
hardware = { hardware.graphics = {
graphics = {
enable = true; enable = true;
extraPackages = with pkgs.unstable; [ extraPackages = with pkgs; [
intel-media-driver intel-media-driver
intel-vaapi-driver intel-vaapi-driver
libvdpau-va-gl libvdpau-va-gl
(pkgs.mesa) mesa
]; ];
}; };
bluetooth = {
hardware.bluetooth = {
enable = true; enable = true;
powerOnBoot = true; powerOnBoot = true;
settings.General = { settings = {
General = {
Experimental = true; Experimental = true;
FastConnectable = true; FastConnectable = true;
}; };
settings.Policy.AutoEnable = true; Policy.AutoEnable = true;
}; };
}; };
@@ -166,27 +203,26 @@
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
boot = { # Bootloader.
loader.systemd-boot = { boot.loader.systemd-boot = {
enable = true; enable = true;
configurationLimit = 10; configurationLimit = 10;
}; };
loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
kernelParams = [ "console=tty1" ]; boot.kernelParams = [ "console=tty1" ];
kernelPackages = pkgs.unstable.linuxPackages_latest;
};
networking = { boot.kernelPackages = pkgs.linuxPackages_latest;
hostName = hostname;
firewall.enable = false; networking.hostName = env.hostname;
networkmanager.enable = true; networking.firewall.enable = false;
};
networking.networkmanager.enable = true;
time.timeZone = "Europe/Stockholm"; time.timeZone = "Europe/Stockholm";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "sv_SE.UTF-8"; LC_ADDRESS = "sv_SE.UTF-8";
LC_IDENTIFICATION = "sv_SE.UTF-8"; LC_IDENTIFICATION = "sv_SE.UTF-8";
@@ -205,5 +241,5 @@
# this value at the release version of the first install of this system. # this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option # Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment? system.stateVersion = stateVersion; # Did you read the comment?
} }
Generated
+1 -70
View File
@@ -37,79 +37,10 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": {
"locked": {
"lastModified": 1772963539,
"narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1772963539,
"narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"overlay": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"path": "./pkgs",
"type": "path"
},
"original": {
"path": "./pkgs",
"type": "path"
},
"parent": []
},
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"nixpkgs-unstable": "nixpkgs-unstable",
"overlay": "overlay",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1773096132,
"narHash": "sha256-M3zEnq9OElB7zqc+mjgPlByPm1O5t2fbUrH3t/Hm5Ag=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "d1ff3b1034d5bab5d7d8086a7803c5a5968cd784",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
} }
} }
}, },
+5 -33
View File
@@ -2,24 +2,15 @@
description = "System configuration"; description = "System configuration";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-25.11"; home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
overlay.url = "path:./pkgs";
}; };
outputs = outputs =
{ {
self, self,
nixpkgs, nixpkgs,
nixpkgs-unstable,
home-manager, home-manager,
sops-nix,
overlay,
}@inputs: }@inputs:
let let
systems = [ systems = [
@@ -28,43 +19,24 @@
"x86_64-linux" "x86_64-linux"
"aarch64-darwin" "aarch64-darwin"
"x86_64-darwin" "x86_64-darwin"
]; ];
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
hostname = "blueplum";
env = import ./${hostname}.nix;
in in
{ {
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt); formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt);
nixosConfigurations.blueplum = nixpkgs.lib.nixosSystem { nixosConfigurations.blueplum = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs hostname env; }; specialArgs = { inherit inputs; };
modules = [ modules = [
{
nixpkgs.overlays = [
overlay.overlays.default
(final: prev: {
unstable = import nixpkgs-unstable {
inherit (final) config;
inherit (final.stdenv.hostPlatform) system;
};
})
];
}
./configuration.nix ./configuration.nix
./blueplum.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager = { home-manager.useGlobalPkgs = true;
useGlobalPkgs = true; home-manager.useUserPackages = true;
useUserPackages = true; home-manager.users.anton = import ./home.nix;
users.anton = import ./home.nix;
sharedModules = import ./modules;
extraSpecialArgs = { inherit hostname env; };
};
} }
sops-nix.nixosModules.sops
]; ];
}; };
}; };
} }
+40 -33
View File
@@ -1,21 +1,19 @@
{ {
pkgs, pkgs,
lib, lib ? pkgs.lib,
env,
... ...
}: }:
let let
# env = import ./.env.nix { inherit pkgs; }; mpkgs = import ./pkgs/default.nix { };
inherit (mpkgs.config) neovim fish;
env = import ./.env.nix { inherit pkgs; };
home = /home/anton; home = /home/anton;
in in
{ {
imports = [ imports = [ ];
./home/vesktop.nix
./home/kitty.nix
./home/i3.nix
]
++ lib.optional (env ? homeManager) env.homeManager;
home.username = lib.mkDefault "anton"; home.username = lib.mkDefault "anton";
home.homeDirectory = lib.mkDefault home; home.homeDirectory = lib.mkDefault home;
@@ -29,6 +27,7 @@ in
vscode vscode
godotPackages_4_5.godot godotPackages_4_5.godot
neovim
btop btop
xclip xclip
tree tree
@@ -37,6 +36,9 @@ in
hyperfine hyperfine
bat bat
typst
tinymist
# required by spotify # required by spotify
ffmpeg_4 ffmpeg_4
]; ];
@@ -49,25 +51,23 @@ in
package = pkgs.posy-cursors; package = pkgs.posy-cursors;
}; };
xsession = {
enable = true;
windowManager.i3 = import ./home/i3.nix { inherit pkgs; };
};
programs.btop.enable = true; programs.btop.enable = true;
programs.fastfetch.enable = true; programs.fastfetch.enable = true;
programs.direnv = { programs.kitty = import ./home/kitty.nix { inherit pkgs; };
enable = true;
nix-direnv.enable = true;
};
programs.fish = programs.fish = {
let
config = pkgs.configs.fish;
in
{
enable = true; enable = true;
shellInit = '' shellInit = ''
set fish_function_path $fish_function_path ${config}/functions set fish_function_path $fish_function_path ${fish}/functions
''; '';
interactiveShellInit = '' interactiveShellInit = ''
source ${config}/config.fish source ${fish}/config.fish
''; '';
}; };
@@ -77,13 +77,9 @@ in
programs.neovim = { programs.neovim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
extraConfig = extraConfig = ''
let set runtimepath+=${neovim}
config = pkgs.configs.neovim; source ${neovim}/init.lua
in
''
set runtimepath+=${config}
source ${config}/init.lua
''; '';
}; };
@@ -96,6 +92,15 @@ in
programs.git = { programs.git = {
enable = true; enable = true;
signing =
if (env.git or { }) ? signingKey then
{
key = env.git.signingKey;
signByDefault = true;
}
else
{ signByDefault = false; };
settings = { settings = {
user.name = "Anton"; user.name = "Anton";
user.email = "aligator.h0spital.e@gmail.com"; user.email = "aligator.h0spital.e@gmail.com";
@@ -119,10 +124,10 @@ in
}; };
"url \"ssh://git@github.com/\"".insteadOf = "gh:"; "url \"ssh://git@github.com/\"".insteadOf = "gh:";
"url \"ssh://git@github.com/antonw51\"".insteadOf = "gh/me:"; "url \"ssh://git@github.com/antonw51\"".insteadOf = "gh:me";
"url \"ssh://git@ip.louiscreates.com/\"".insteadOf = "tea:"; "url \"ssh://git@ip.louiscreates.com/\"".insteadOf = "tea:";
"url \"ssh://git@ip.louiscreates.com/antonw51\"".insteadOf = "tea/me:"; "url \"ssh://git@ip.louiscreates.com/antonw51\"".insteadOf = "tea:me";
alias.ref = "show -s --pretty = reference"; alias.ref = "show -s --pretty = reference";
}; };
@@ -130,12 +135,12 @@ in
programs.tetrio-desktop = { programs.tetrio-desktop = {
enable = true; enable = true;
package = pkgs.tetrio.desktop; package = mpkgs.tetrio.desktop;
plus = { plus = {
enable = true; enable = true;
package = pkgs.tetrio.plus; package = mpkgs.tetrio.plus;
skin.package = pkgs.tetrio.skins.simple-connected; skin.package = mpkgs.tetrio.skins.simple-connected;
}; };
settings = { settings = {
@@ -188,6 +193,8 @@ in
}; };
}; };
programs.vesktop = import ./home/vesktop.nix;
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
@@ -210,5 +217,5 @@ in
NIXPKGS_ALLOW_UNFREE = 1; NIXPKGS_ALLOW_UNFREE = 1;
}; };
home.stateVersion = "25.11"; home.stateVersion = mpkgs.system.stateVersion;
} }
+18 -13
View File
@@ -1,16 +1,17 @@
{ {
pkgs, pkgs,
lib, lib ? pkgs.lib,
env,
... ...
}: }:
let let
mod = "Mod4"; mod = "Mod4";
displays = if env ? displays then env.displays else null;
wallpaper = pkgs.callPackage ../pkgs/wallpaper/default.nix { };
env = import /etc/nixos/.env.nix { inherit pkgs; };
in in
{ {
xsession.windowManager.i3 = {
enable = true; enable = true;
config = { config = {
@@ -68,7 +69,7 @@ in
"--" "--"
(lib.concatStringsSep " " [ (lib.concatStringsSep " " [
(lib.getExe pkgs.mpv) (lib.getExe pkgs.mpv)
"${pkgs.wallpaper}/wallpaper.mov" "${wallpaper}/wallpaper.mov"
"-wid WID" "-wid WID"
"--loop" "--loop"
"--no-audio" "--no-audio"
@@ -82,20 +83,24 @@ in
"--hwdec=auto" "--hwdec=auto"
]) ])
]; ];
displayConf = displays =
if displays != null then if (env ? displays) then
lib.concatStringsSep "\n" [ lib.concatStringsSep "\n" [
"workspace 1 output ${displays.primary}" "workspace 1 output ${env.displays.primary}"
(if (displays ? secondary) then "workspace 2 output ${displays.secondary}" else "") (if (env.displays ? secondary) then "workspace 2 output ${env.displays.secondary}" else "")
"exec i3-msg focus output ${displays.primary}" "exec i3-msg focus output ${env.displays.primary}"
(if (displays ? xrandr) then "exec \"${lib.getExe pkgs.xrandr} ${displays.xrandr}\"" else "") (
if (env.displays ? xrandr) then
"exec \"${lib.getExe pkgs.xrandr} ${env.displays.xrandr}\""
else
""
)
] ]
else else
""; "";
in in
lib.concatStringsSep "\n" [ lib.concatStringsSep "\n" [
background background
displayConf displays
]; ];
};
} }
+35 -45
View File
@@ -1,59 +1,49 @@
{ { pkgs, ... }:
pkgs,
lib,
...
}:
let
makeTheme =
attrs: builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "${k} ${toString v}") attrs);
in
{ {
programs.kitty = {
enable = true; enable = true;
font = { font = {
package = pkgs.jetbrains-mono; package = pkgs.jetbrains-mono;
name = "JetBrains Mono"; name = "JetBrains Mono";
size = 13; size = 13;
}; };
extraConfig = makeTheme { extraConfig = ''
foreground = "#f2f4f8"; foreground #f2f4f8
background = "#161616"; background #161616
selection_foreground = "#f2f4f8"; selection_foreground #f2f4f8
selection_background = "#2a2a2a"; selection_background #2a2a2a
cursor = "#f2f4f8"; cursor #f2f4f8
cursor_text_color = "#161616"; cursor_text_color #161616
url_color = "#25be6a"; url_color #25be6a
active_border_color = "#78a9ff"; active_border_color #78a9ff
inactive_border_color = "#535353"; inactive_border_color #535353
bell_border_color = "#3ddbd9"; bell_border_color #3ddbd9
active_tab_foreground = "#0c0c0c"; active_tab_foreground #0c0c0c
active_tab_background = "#78a9ff"; active_tab_background #78a9ff
inactive_tab_foreground = "#6e6f70"; inactive_tab_foreground #6e6f70
inactive_tab_background = "#2a2a2a"; inactive_tab_background #2a2a2a
color0 = "#282828"; color0 #282828
color8 = "#484848"; color8 #484848
color1 = "#ee5396"; color1 #ee5396
color9 = "#f16da6"; color9 #f16da6
color2 = "#25be6a"; color2 #25be6a
color10 = "#46c880"; color10 #46c880
color3 = "#ebcb8b"; color3 #ebcb8b
color11 = "#f0d399"; color11 #f0d399
color4 = "#78a9ff"; color4 #78a9ff
color12 = "#8cb6ff"; color12 #8cb6ff
color5 = "#be95ff"; color5 #be95ff
color13 = "#c8a5ff"; color13 #c8a5ff
color6 = "#33b1ff"; color6 #33b1ff
color14 = "#52bdff"; color14 #52bdff
color7 = "#dfdfe0"; color7 #dfdfe0
color15 = "#e4e4e5"; color15 #e4e4e5
color16 = "#3ddbd9"; color16 #3ddbd9
color17 = "#ff7eb6"; color17 #ff7eb6
}; '';
};
} }
+1 -16
View File
@@ -1,21 +1,6 @@
{ { lib, ... }:
pkgs,
configs ? pkgs.configs,
...
}:
{ {
programs.neovim = {
enable = true; enable = true;
defaultEditor = true;
extraConfig =
let
config = configs.neovim;
in
''
set runtimepath+=${config}
source ${config}/init.lua
'';
};
} }
-4
View File
@@ -1,7 +1,4 @@
{ ... }:
{ {
programs.vesktop = {
enable = true; enable = true;
settings = { settings = {
discordBranch = "stable"; discordBranch = "stable";
@@ -316,5 +313,4 @@
WebContextMenus.enabled = true; WebContextMenus.enabled = true;
}; };
}; };
};
} }
-4
View File
@@ -1,4 +0,0 @@
[
./tetrio
./initialFile.nix
]
-172
View File
@@ -1,172 +0,0 @@
{
pkgs,
lib ? pkgs.lib,
config,
...
}:
let
inherit (lib) mkOption types;
cfg = lib.filterAttrs (n: f: f.enable) config.home.initialFile;
home = config.home.homeDirectory;
in
{
options = {
home.initialFile = mkOption {
type = types.attrsOf (
types.submodule (
{ name, config, ... }:
{
options = {
enable = mkOption {
type = types.bool;
default = true;
};
target = mkOption {
type = types.str;
apply =
path:
let
absPath = if lib.hasPrefix "/" path then path else "${home}/${path}";
in
lib.removePrefix (home + "/") absPath;
description = "Path to target file relative to home directory";
default = "/homeless-shelter/home";
};
text = mkOption {
type = types.nullOr types.lines;
description = "Text of the file, otherwise copies .source file.";
default = null;
};
source = mkOption {
type = types.path;
description = "Path of file whose source to copy";
};
mode = mkOption {
type = types.nullOr types.str;
description = "File mode to apply to target file (sourced from .source / .text if not specified)";
default = null;
};
dir_mode = mkOption {
type = types.str;
description = "File mode to apply to directories";
default = "0755";
};
recursive = mkOption {
type = types.bool;
description = "Whether or not to recursively copy .source as a directory instead of as a file";
default = false;
};
force = mkOption {
type = types.bool;
description = "Whether to unconditionally replace the target file, even if it already exists.";
default = false;
};
};
config = {
target = lib.mkDefault name;
source = lib.mkIf (config.text != null) (
lib.mkDefault (
pkgs.writeTextFile {
inherit (config) text;
name = lib.hm.strings.storeFileName name;
}
)
);
};
}
)
);
description = "Attribute set of files to write into the user home (if they don't already exist).";
default = { };
};
};
config = {
assertions = [
(
let
dups = lib.attrNames (
lib.filterAttrs (n: v: v > 1) (
lib.foldAttrs (acc: v: acc + v) 0 (lib.mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)
)
);
dupsStr = lib.concatStringsSep ", " dups;
in
{
assertion = dups == [ ];
message = ''
Conflicting managed target files: ${dupsStr}
This may happen, for example, if you have a configuration similar to
home.initialFile = {
conflict1 = { source = ./foo.nix; target = "baz"; };
conflict2 = { source = ./bar.nix; target = "baz"; };
}'';
}
)
];
home.activation.copyInitialFiles = lib.hm.dag.entryAfter [ "writeBoundary" ] (
let
homeArg = lib.escapeShellArg home;
in
''
function copyFile() {
local source="$1"
local targetRel="$2"
local mode="$3"
local dirMode="$4"
local recursive="$5"
local force="$6"
local target="${homeArg}/$targetRel"
if [[ -e "$target" && "$force" != "true" ]]; then
verboseEcho "Skipping existing $target"
return 0
fi
run mkdir -p "$(dirname "$target")"
if [[ -d "$source" ]]; then
if [[ "$recursive" != "true" ]]; then
errorEcho "Source '$source' is a directory but recursive=false"
return 1
fi
run rm -rf "$target"
run cp -r "$source" "$target"
else
if [[ -e "$target" && "$force" == "true" ]]; then
run rm -f "$target"
fi
run cp "$source" "$target"
fi
if [[ -n "$mode" ]]; then
if [[ -d "$target" && "$recursive" == "true" ]]; then
run chmod "$dirMode" "$target"
find "$target" -type f -exec chmod "$mode" {} +
else
run chmod "$mode" "$target"
fi
fi
}
''
+ lib.concatMapStrings (
v:
let
src = lib.escapeShellArg (toString v.source);
tgt = lib.escapeShellArg v.target;
mode = if v.mode == null then "''" else lib.escapeShellArg v.mode;
in
''
copyFile ${src} ${tgt} ${mode} ${lib.escapeShellArg v.dir_mode} ${lib.trivial.boolToString v.recursive} ${lib.trivial.boolToString v.force}
''
) (lib.attrValues cfg)
);
};
}
File diff suppressed because it is too large Load Diff
-32
View File
@@ -1,32 +0,0 @@
{
stdenv,
lib,
leveldb-cli,
value,
origin ? "https://tetr.io",
key ? "userConfig",
}:
let
src = ./.;
in
stdenv.mkDerivation {
pname = "tetrio-leveldb";
version = "1";
inherit src;
nativeBuildInputs = [ leveldb-cli ];
buildPhase = ''
runHook preBuild
${lib.getExe leveldb-cli} \
$out \
${lib.escapeShellArg origin} \
${lib.escapeShellArg key} \
${lib.escapeShellArg (builtins.toJSON value)}
runHook postBuild
'';
}
+35 -11
View File
@@ -1,22 +1,32 @@
final: prev: {
pkgs ? import <nixpkgs> { config.allowUnfree = true; },
config ? (import <nixpkgs/nixos> { }).config,
fetchzip ? pkgs.fetchzip,
...
}:
let let
fetchzip = prev.fetchzip; system = {
use = path: prev.callPackage (import path) { pkgs = prev; }; stateVersion = config.system.stateVersion;
};
use = path: pkgs.callPackage (import path) { inherit pkgs; };
in in
{ {
wallpaper = use ./wallpaper; inherit system;
tetrio.desktop = use ./tetrio;
wallpaper = use ./wallpaper/default.nix;
tetrio.desktop = use ./tetrio/default.nix;
tetrio.plus = tetrio.plus =
let let
repo = { repo = {
owner = "UniQMG"; owner = "UniQMG";
name = "tetrio-plus"; name = "tetrio-plus";
job = "11675178434"; job = "11675178434";
hash = "sha256-j3ACcnT64eMQtWYDGOE2oGXpnN5EUqk+lyV6ARBEtU8=";
}; };
src = fetchzip { src = fetchzip {
url = "https://gitlab.com/${repo.owner}/${repo.name}/-/jobs/${repo.job}/artifacts/raw/app.asar.zip"; url = "https://gitlab.com/${repo.owner}/${repo.name}/-/jobs/${repo.job}/artifacts/raw/app.asar.zip";
hash = "sha256-j3ACcnT64eMQtWYDGOE2oGXpnN5EUqk+lyV6ARBEtU8="; hash = repo.hash;
}; };
in in
"${src}/app.asar"; "${src}/app.asar";
@@ -24,11 +34,25 @@ in
simple-connected = use ./tetrio/skins/simple-connected.nix; simple-connected = use ./tetrio/skins/simple-connected.nix;
}; };
leveldb-cli = use ./leveldb; leveldb-cli = use ./leveldb/default.nix;
configs.neovim = use ./neovim; config.neovim = use ./neovim/default.nix;
configs.fish = use ./fish; config.fish = use ./fish/default.nix;
nimbus-roman = use ./nimbus; font.monaco = use ./monaco-font/default.nix;
monaco = use ./monaco-font;
home-manager = {
module =
let
home-manager = fetchzip {
url = "https://github.com/nix-community/home-manager/archive/master.tar.gz";
hash = "sha256-UZjPc/d5XRxvjDbk4veAO4XFdvx6BUum2l40V688Xq8=";
};
in
import "${home-manager}/nixos";
sharedModules = [
./home-manager/initialFile.nix
./tetrio/module.nix
];
};
} }
+180
View File
@@ -0,0 +1,180 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
makeDesktopItem,
nodejs,
electron_39,
element-web,
sqlcipher,
callPackage,
typescript,
# command line arguments which are always set
commandLineArgs ? "",
yarnConfigHook,
yarnBuildHook,
fetchYarnDeps,
asar,
copyDesktopItems,
darwin,
...
}:
let
pinData = import ./element-desktop-pin.nix;
inherit (pinData.hashes) desktopSrcHash desktopYarnHash;
executableName = "element-desktop";
electron = electron_39;
seshat = callPackage ./seshat { };
in
stdenv.mkDerivation (
finalAttrs:
removeAttrs pinData [ "hashes" ]
// {
pname = "element-desktop";
name = "${finalAttrs.pname}-${finalAttrs.version}";
src = fetchFromGitHub {
owner = "element-hq";
repo = "element-desktop";
rev = "v${finalAttrs.version}";
hash = desktopSrcHash;
};
offlineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = desktopYarnHash;
};
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
nativeBuildInputs = [
asar
copyDesktopItems
nodejs
makeWrapper
typescript
yarnConfigHook
yarnBuildHook
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.autoSignDarwinBinariesHook ];
inherit seshat;
# Only affects unused scripts in $out/share/element/electron/scripts. Also
# breaks because there are some `node`-scripts with a `npx`-shebang and
# this shouldn't be in the closure just for unused scripts.
dontPatchShebangs = true;
postPatch = ''
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist
substituteInPlace package.json \
--replace-fail \
' electron-builder",' \
' electron-builder --dir -c.electronDist=electron-dist -c.electronVersion=${electron.version} -c.mac.identity=null",'
# `@electron/fuses` tries to run `codesign` and fails. Disable and use autoSignDarwinBinariesHook instead
substituteInPlace ./electron-builder.ts \
--replace-fail "resetAdHocDarwinSignature:" "// resetAdHocDarwinSignature:"
# Need to disable asar integrity check to copy in native seshat files, see postBuild phase
substituteInPlace ./electron-builder.ts \
--replace-fail "enableEmbeddedAsarIntegrityValidation: true" "enableEmbeddedAsarIntegrityValidation: false"
'';
preBuild = ''
# Apply upstream patch
# Can be removed if upstream removes patches/@types+auto-launch+5.0.5.patch introduced in
# https://github.com/element-hq/element-desktop/commit/5e882f8e08d58bf9663c8e3ab33885bf7b3709de
node ./node_modules/patch-package/index.js
'';
postBuild = ''
# relative path to app.asar differs on Linux and MacOS
packed=$(find ./dist -name app.asar)
asar extract "$packed" tmp-app
# linking here leads to Error: tmp-app/node_modules/matrix-seshat: file ... links out of the package
cp -r $seshat tmp-app/node_modules/matrix-seshat
asar pack tmp-app "$packed"
'';
installPhase = ''
runHook preInstall
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out/Applications" "$out/bin"
mv dist/mac*/Element.app "$out/Applications"
ln -s '${element-web}' "$out/Applications/Element.app/Contents/Resources/webapp"
wrapProgram "$out/Applications/Element.app/Contents/MacOS/Element" \
--add-flags ${lib.escapeShellArg commandLineArgs}
makeWrapper "$out/Applications/Element.app/Contents/MacOS/Element" "$out/bin/${executableName}"
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
mkdir -p "$out/bin" "$out/share"
cp -a dist/*-unpacked/resources $out/share/element
ln -s '${element-web}' "$out/share/element/webapp"
# icon, used in makeDesktopItem
mkdir -p "$out/share/icons/hicolor/512x512/apps"
ln -s "$out/share/element/build/icon.png" "$out/share/icons/hicolor/512x512/apps/element.png"
# executable wrapper
# LD_PRELOAD workaround for sqlcipher not found: https://github.com/matrix-org/seshat/issues/102
makeWrapper '${lib.getExe electron}' "$out/bin/${executableName}" \
--set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher.so \
--add-flags "$out/share/element/app.asar" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--add-flags ${lib.escapeShellArg commandLineArgs}
''
+ ''
runHook postInstall
'';
# The desktop item properties should be kept in sync with data from upstream:
# https://github.com/element-hq/element-desktop/blob/develop/package.json
desktopItems = [
(makeDesktopItem {
name = "element-desktop";
exec = "${executableName} %u";
icon = "element";
desktopName = "Element";
genericName = "Matrix Client";
comment = finalAttrs.meta.description;
categories = [
"Network"
"InstantMessaging"
"Chat"
];
startupWMClass = "Element";
mimeTypes = [
"x-scheme-handler/element"
"x-scheme-handler/io.element.desktop"
];
})
];
passthru = {
# run with: nix-shell ./maintainers/scripts/update.nix --argstr package element-desktop
updateScript = ./update.sh;
};
meta = {
description = "Feature-rich client for Matrix.org";
homepage = "https://element.io/";
changelog = "https://github.com/element-hq/element-desktop/blob/v${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.agpl3Plus;
teams = [ lib.teams.matrix ];
inherit (electron.meta) platforms;
mainProgram = "element-desktop";
};
}
)
+7
View File
@@ -0,0 +1,7 @@
{
"version" = "1.12.10";
"hashes" = {
"desktopSrcHash" = "sha256-2LQBT3+2JTR3XHO3DynOp8cw2m2SB/mGH01e3SFD/IM=";
"desktopYarnHash" = "sha256-QIzuVKmUS4tqXAzhpfLZOp51kLbfC1M2nrff8e+sdg4=";
};
}
+74
View File
@@ -0,0 +1,74 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
sqlcipher,
nodejs,
python3,
yarn,
fixup-yarn-lock,
fetchYarnDeps,
removeReferencesTo,
}:
let
pinData = lib.importJSON ./pin.json;
in
rustPlatform.buildRustPackage rec {
pname = "seshat-node";
inherit (pinData) version cargoHash;
src = fetchFromGitHub {
owner = "matrix-org";
repo = "seshat";
rev = version;
hash = pinData.srcHash;
};
sourceRoot = "${src.name}/seshat-node/native";
nativeBuildInputs = [
nodejs
python3
yarn
fixup-yarn-lock
];
buildInputs = [ sqlcipher ];
npm_config_nodedir = nodejs;
yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/seshat-node/yarn.lock";
sha256 = pinData.yarnHash;
};
buildPhase = ''
runHook preBuild
cd ..
chmod u+w . ./yarn.lock
export HOME=$PWD/tmp
mkdir -p $HOME
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
node_modules/.bin/neon build --release -- --target ${stdenv.hostPlatform.rust.rustcTarget} -Z unstable-options --out-dir target/release
runHook postBuild
'';
doCheck = false;
installPhase = ''
runHook preInstall
shopt -s extglob
rm -rf native/!(index.node)
rm -rf node_modules $HOME
cp -r . $out
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $out/native/index.node
runHook postInstall
'';
disallowedReferences = [ stdenv.cc.cc ];
}
+6
View File
@@ -0,0 +1,6 @@
{
"version": "2.3.3",
"srcHash": "sha256-HmKHWFoO8TQ9S/RcJnJ3h85/2uSkqGrgLnX82hkux4Q=",
"yarnHash": "1cbkv8ap7f8vxl5brzqb86d2dyxg555sz67cldrp0vgnk8sq6ibp",
"cargoHash": "sha256-klrFk0gpqQu/9MzLEYMNqEBETZMXtZJX67Sm5ZqyHfE=="
}
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=../../../../../../ -i bash -p wget prefetch-yarn-deps yarn nix-prefetch nix-prefetch-github
if [ "$#" -gt 1 ] || [[ "$1" == -* ]]; then
echo "Regenerates packaging data for the seshat package."
echo "Usage: $0 [git release tag]"
exit 1
fi
version="$1"
set -euo pipefail
if [ -z "$version" ]; then
version="$(wget -O- "https://api.github.com/repos/matrix-org/seshat/tags" | jq -r '.[] | .name' | sort --version-sort | tail -1)"
fi
SRC="https://raw.githubusercontent.com/matrix-org/seshat/$version"
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
pushd $tmpdir
wget "$SRC/seshat-node/yarn.lock"
yarn_hash=$(prefetch-yarn-deps yarn.lock)
popd
src_hash=$(nix-prefetch-github matrix-org seshat --rev ${version} | jq -r .hash)
cat > pin.json << EOF
{
"version": "$version",
"srcHash": "$src_hash",
"yarnHash": "$yarn_hash",
"cargoHash": "0000000000000000000000000000000000000000000000000000"
}
EOF
cargo_hash=$(nix-prefetch "{ sha256 }: (import ../../../../../.. {}).element-desktop.seshat.cargoDeps")
cat > pin.json << EOF
{
"version": "$version",
"srcHash": "$src_hash",
"yarnHash": "$yarn_hash",
"cargoHash": "$cargo_hash"
}
EOF
+6 -2
View File
@@ -1,6 +1,10 @@
{ stdenv, ... }: {
pkgs ? import <nixpkgs> { },
lib ? pkgs.lib,
...
}:
stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "fish-config"; pname = "fish-config";
version = "1.0"; version = "1.0";
+1 -1
View File
@@ -49,7 +49,7 @@ function fish_prompt
set -ql packages[4]; and set nix_shell "$nix_shell, +$(math (count $packages) - 2) more" set -ql packages[4]; and set nix_shell "$nix_shell, +$(math (count $packages) - 2) more"
set -ql packages[1]; and set nix_shell "$nix_shell) " set -ql packages[1]; set nix_shell "$nix_shell) "
end end
end end
-10
View File
@@ -1,10 +0,0 @@
{
description = "Pkgs overlay";
inputs = { };
outputs =
{ self, ... }:
{
overlays.default = final: prev: (import ./default.nix final prev);
};
}
+5 -3
View File
@@ -1,10 +1,12 @@
{ buildGoModule, fetchFromGitHub, ... }: {
pkgs ? import <nixpkgs> { },
}:
buildGoModule { pkgs.buildGoModule {
name = "leveldb-cli"; name = "leveldb-cli";
version = "1.0.0"; version = "1.0.0";
src = fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "theblueplum"; owner = "theblueplum";
repo = "leveldb-cli"; repo = "leveldb-cli";
rev = "main"; rev = "main";
+6 -2
View File
@@ -1,6 +1,10 @@
{ stdenv, lib, ... }: {
pkgs ? import <nixpkgs> { system = builtins.currentSystem; },
lib ? pkgs.lib,
...
}:
stdenv.mkDerivation { pkgs.stdenv.mkDerivation rec {
pname = "monaco-font"; pname = "monaco-font";
version = "1.0"; version = "1.0";
+1
View File
@@ -0,0 +1 @@
/nix/store/kp450zrxxva5fv7wwpnz841vgxan6c49-nixos-system-blueplum-25.05.811874.daf6dc47aa4b

Some files were not shown because too many files have changed in this diff Show More