mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 03:07:17 +00:00
Restructrues entire flake
This commit is contained in:
parent
1f8fb78834
commit
8fa83a3bd0
64 changed files with 263 additions and 609 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,4 +2,5 @@
|
||||||
.\#*
|
.\#*
|
||||||
/.direnv
|
/.direnv
|
||||||
/.pre-commit-config.yaml
|
/.pre-commit-config.yaml
|
||||||
|
nixos.qcow2
|
||||||
result
|
result
|
||||||
|
|
15
common/globals.nix
Normal file
15
common/globals.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
keyboard.layout = "us";
|
||||||
|
keyboard.variant = "colemak";
|
||||||
|
|
||||||
|
language = "en_US.UTF-8";
|
||||||
|
|
||||||
|
sshkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBx1z962nl87rmOk/vw3EBSgqU/VlCqON8zTeLHQcSBp willem@zeus";
|
||||||
|
|
||||||
|
zsh.prompt = "\n%B%F{cyan}%m:%F{blue}%~\n%F{green}$ %f%";
|
||||||
|
zsh.rprompt = "%B%F{red}%*%f%b";
|
||||||
|
|
||||||
|
timezone = "America/Vancouver";
|
||||||
|
|
||||||
|
username = "willem";
|
||||||
|
}
|
44
common/system.nix
Normal file
44
common/system.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
globals,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
environment.pathsToLink = ["/share/zsh"];
|
||||||
|
environment.shells = [pkgs.bashInteractive pkgs.zsh];
|
||||||
|
environment.systemPackages = [pkgs.coreutils pkgs.git];
|
||||||
|
environment.variables.LANG = "en_US.UTF-8";
|
||||||
|
environment.variables.LANGUAGE = "en_US.UTF-8";
|
||||||
|
environment.variables.LC_ALL = "en_US.UTF-8";
|
||||||
|
environment.variables.LC_CTYPE = "en_US.UTF-8";
|
||||||
|
environment.variables.SHELL = "${pkgs.zsh}/bin/zsh";
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nix;
|
||||||
|
settings.experimental-features = ["nix-command" "flakes" "repl-flake"];
|
||||||
|
settings.trusted-users = ["root" "willem"];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.nix-index.enable = false;
|
||||||
|
|
||||||
|
programs.bash.enableCompletion = true;
|
||||||
|
programs.bash.interactiveShellInit = ''
|
||||||
|
export PS1=$'\n'"\e[0mbash: \e[34;1m\w"$'\n'"\e[32m\\$\e[0m "
|
||||||
|
'';
|
||||||
|
|
||||||
|
documentation.enable = true;
|
||||||
|
documentation.man.enable = true;
|
||||||
|
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
programs.zsh.shellInit = lib.mkDefault "zsh-newuser-install() { :; }";
|
||||||
|
programs.zsh.enableBashCompletion = true;
|
||||||
|
programs.zsh.promptInit = lib.mkDefault ''
|
||||||
|
autoload -U promptinit && promptinit
|
||||||
|
export PROMPT="${globals.zsh.prompt}"
|
||||||
|
export RPROMPT="${globals.zsh.rprompt}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
time.timeZone = globals.timezone;
|
||||||
|
|
||||||
|
users.users.willem.shell = pkgs.zsh;
|
||||||
|
}
|
|
@ -1,19 +0,0 @@
|
||||||
# Copyright (c) 2018 Terje Larsen
|
|
||||||
# This work is licensed under the terms of the MIT license.
|
|
||||||
# For a copy, see https://opensource.org/licenses/MIT.
|
|
||||||
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/apps.nix
|
|
||||||
{lib, ...}: {
|
|
||||||
perSystem = {pkgs, ...}:
|
|
||||||
lib.pipe ../apps [
|
|
||||||
lib.filesystem.listFilesRecursive
|
|
||||||
(map (file: pkgs.callPackage file {}))
|
|
||||||
(map (drv: {
|
|
||||||
apps.${drv.name} = {
|
|
||||||
type = "app";
|
|
||||||
program = lib.getExe drv;
|
|
||||||
};
|
|
||||||
checks."app-${drv.name}" = drv;
|
|
||||||
}))
|
|
||||||
(lib.fold lib.recursiveUpdate {})
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./apps.nix
|
|
||||||
./home-manager
|
|
||||||
./lib
|
|
||||||
./nixos
|
|
||||||
./overlays.nix
|
|
||||||
./packages.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
flake-parts-lib,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkOption types;
|
|
||||||
inherit (flake-parts-lib) mkTransposedPerSystemModule;
|
|
||||||
in
|
|
||||||
mkTransposedPerSystemModule
|
|
||||||
{
|
|
||||||
name = "homeConfigurations";
|
|
||||||
file = ./configurations.nix;
|
|
||||||
option = mkOption {
|
|
||||||
type = types.lazyAttrsOf types.unspecified;
|
|
||||||
default = {};
|
|
||||||
description = "Home Manager user configurations.";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
# Copyright (c) 2018 Terje Larsen
|
|
||||||
# This work is licensed under the terms of the MIT license.
|
|
||||||
# For a copy, see https://opensource.org/licenses/MIT.
|
|
||||||
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/home-manager/modules.nix
|
|
||||||
{
|
|
||||||
lib,
|
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
flake.homeManagerModules = let
|
|
||||||
modules = self.lib.importDirToAttrs ../../home-manager;
|
|
||||||
non-specific-modules = lib.filterAttrs (n: v: (!(lib.hasInfix "darwin" n) && !(lib.hasInfix "linux" n))) modules;
|
|
||||||
darwin-modules = lib.filterAttrs (n: v: (lib.hasInfix "darwin" n)) modules;
|
|
||||||
linux-modules = lib.filterAttrs (n: v: (lib.hasInfix "linux" n)) modules;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
default = {
|
|
||||||
imports = builtins.attrValues non-specific-modules;
|
|
||||||
};
|
|
||||||
|
|
||||||
darwin = {
|
|
||||||
imports = builtins.attrValues darwin-modules;
|
|
||||||
};
|
|
||||||
|
|
||||||
linux = {
|
|
||||||
imports = builtins.attrValues linux-modules;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs-config = {
|
|
||||||
nixpkgs.config.allowUnfreePredicate = _: true;
|
|
||||||
nixpkgs.config.allowUnsupportedSystem = true;
|
|
||||||
nixpkgs.overlays = builtins.attrValues self.overlays;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs-useFlakeNixpkgs = {
|
|
||||||
home.sessionVariables.NIX_PATH = "nixpkgs=${inputs.nixpkgs}";
|
|
||||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
|
||||||
};
|
|
||||||
|
|
||||||
hyprland = {
|
|
||||||
imports = [
|
|
||||||
inputs.hyprland.homeManagerModules.default
|
|
||||||
{wayland.windowManager.hyprland.enable = true;}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// modules;
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
flake = {
|
|
||||||
homeManagerModules.user-willem = {
|
|
||||||
imports = [
|
|
||||||
self.homeManagerModules.default
|
|
||||||
inputs.nix-index-database.hmModules.nix-index
|
|
||||||
];
|
|
||||||
|
|
||||||
home.username = "willem";
|
|
||||||
};
|
|
||||||
|
|
||||||
homeManagerModules.user-willem-darwin = {
|
|
||||||
imports = [
|
|
||||||
self.homeManagerModules.darwin
|
|
||||||
self.homeManagerModules.user-willem
|
|
||||||
self.homeManagerModules.nixpkgs-config
|
|
||||||
self.homeManagerModules.nixpkgs-useFlakeNixpkgs
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.emacs.enableOrgTex = true;
|
|
||||||
|
|
||||||
home.homeDirectory = "/Users/willem";
|
|
||||||
};
|
|
||||||
|
|
||||||
homeManagerModules.user-willem-linux = {
|
|
||||||
imports = [
|
|
||||||
self.homeManagerModules.user-willem
|
|
||||||
self.homeManagerModules.linux
|
|
||||||
inputs.hyprland.homeManagerModules.default
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.emacs.enableOrgTex = false;
|
|
||||||
|
|
||||||
home.homeDirectory = "/home/willem";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
perSystem = {
|
|
||||||
pkgs,
|
|
||||||
self',
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}: rec {
|
|
||||||
homeConfigurations.willem = let
|
|
||||||
systemType =
|
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then "darwin"
|
|
||||||
else "linux";
|
|
||||||
in
|
|
||||||
inputs.home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [self.homeManagerModules."user-willem-${systemType}" {nix.package = pkgs.nix;}];
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = let
|
|
||||||
activationPackages = builtins.mapAttrs (_: lib.getAttr "activationPackage") homeConfigurations;
|
|
||||||
in
|
|
||||||
lib.pipe activationPackages [
|
|
||||||
(lib.filterAttrs (_: drv: pkgs.system == drv.system))
|
|
||||||
(lib.mapAttrs' (username: lib.nameValuePair "home-${username}"))
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
# Copyright (c) 2018 Terje Larsen
|
|
||||||
# This work is licensed under the terms of the MIT license.
|
|
||||||
# For a copy, see https://opensource.org/licenses/MIT.
|
|
||||||
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/lib/default.nix
|
|
||||||
{
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
flake.lib = {
|
|
||||||
kebabCaseToCamelCase =
|
|
||||||
builtins.replaceStrings (map (s: "-${s}") lib.lowerChars) lib.upperChars;
|
|
||||||
|
|
||||||
importDirToAttrs = dir:
|
|
||||||
lib.pipe dir [
|
|
||||||
lib.filesystem.listFilesRecursive
|
|
||||||
(builtins.filter (lib.hasSuffix ".nix"))
|
|
||||||
(map (path: {
|
|
||||||
name = lib.pipe path [
|
|
||||||
toString
|
|
||||||
(lib.removePrefix "${toString dir}/")
|
|
||||||
(lib.removeSuffix "/default.nix")
|
|
||||||
(lib.removeSuffix ".nix")
|
|
||||||
self.lib.kebabCaseToCamelCase
|
|
||||||
(builtins.replaceStrings ["/"] ["-"])
|
|
||||||
];
|
|
||||||
value = import path;
|
|
||||||
}))
|
|
||||||
builtins.listToAttrs
|
|
||||||
];
|
|
||||||
|
|
||||||
mk-mac-binpkg = import ../../packages/mk-mac-binpkg.nix;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hosts.nix
|
|
||||||
./modules.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,86 +0,0 @@
|
||||||
{
|
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
flake = {
|
|
||||||
nixosModules.base = {...}: {
|
|
||||||
imports = [
|
|
||||||
../../nixos/profiles/common.nix
|
|
||||||
../../nixos/profiles/linux/base.nix
|
|
||||||
self.nixosModules.useFlakeNixpkgs
|
|
||||||
self.nixosModules.users-willem
|
|
||||||
inputs.nix-index-database.nixosModules.nix-index
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.overlays = builtins.attrValues self.overlays;
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosModules.darwinArmVM = {...}: {
|
|
||||||
virtualisation.host.pkgs = inputs.nixpkgs.legacyPackages.aarch64-darwin;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosModules.willem-home = {...}: {
|
|
||||||
imports = [
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
self.nixosModules.homeManagerIntegration
|
|
||||||
];
|
|
||||||
home-manager.users.willem = self.homeManagerModules.user-willem-linux;
|
|
||||||
};
|
|
||||||
|
|
||||||
darwinModules.base = {...}: {
|
|
||||||
imports = [
|
|
||||||
../../nixos/profiles/common.nix
|
|
||||||
self.nixosModules.linkNixInputs
|
|
||||||
self.nixosModules.useFlakeNixpkgs
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.overlays = builtins.attrValues self.overlays;
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.nixbox = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
self.nixosModules.base
|
|
||||||
self.nixosModules.willem-home
|
|
||||||
self.nixosModules.hyprland
|
|
||||||
../../nixos/hosts/nixbox.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
specialArgs = {inherit inputs;};
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.arm-live = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "aarch64-linux";
|
|
||||||
modules = [
|
|
||||||
self.nixosModules.base
|
|
||||||
../../nixos/hosts/live.nix
|
|
||||||
];
|
|
||||||
specialArgs = {inherit inputs;};
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.darwinArmMinimalVM = inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "aarch64-linux";
|
|
||||||
modules = [
|
|
||||||
self.nixosModules.users-willemVm
|
|
||||||
self.nixosModules.base
|
|
||||||
self.nixosModules.headlessVm
|
|
||||||
self.nixosModules.darwinArmVM
|
|
||||||
];
|
|
||||||
specialArgs = {inherit inputs;};
|
|
||||||
};
|
|
||||||
|
|
||||||
darwinConfigurations.zeus = inputs.darwin.lib.darwinSystem {
|
|
||||||
system = "aarch64-darwin";
|
|
||||||
modules = [
|
|
||||||
self.darwinModules.base
|
|
||||||
../../nixos/hosts/zeus.darwin.nix
|
|
||||||
];
|
|
||||||
specialArgs = {inherit inputs;};
|
|
||||||
};
|
|
||||||
|
|
||||||
packages.aarch64-darwin.minimalVM = self.nixosConfigurations.darwinArmMinimalVM.config.system.build.vm;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
# Copyright (c) 2018 Terje Larsen
|
|
||||||
# This work is licensed under the terms of the MIT license.
|
|
||||||
# For a copy, see https://opensource.org/licenses/MIT.
|
|
||||||
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/lib/default.nix
|
|
||||||
{
|
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
flake.nixosModules = let
|
|
||||||
modules = self.lib.importDirToAttrs ../../nixos/modules;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
default = {
|
|
||||||
imports = builtins.attrValues modules;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// modules;
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
# Copyright (c) 2018 Terje Larsen
|
|
||||||
# This work is licensed under the terms of the MIT license.
|
|
||||||
# For a copy, see https://opensource.org/licenses/MIT.
|
|
||||||
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/packages.nix
|
|
||||||
{
|
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
perSystem = {
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
overlays = [
|
|
||||||
self.overlays.default
|
|
||||||
];
|
|
||||||
pkgs' = pkgs.extend (lib.composeManyExtensions overlays);
|
|
||||||
in {
|
|
||||||
packages = {
|
|
||||||
inherit
|
|
||||||
(pkgs')
|
|
||||||
darwin-zsh-completions
|
|
||||||
iaito
|
|
||||||
org-auctex
|
|
||||||
pinentry-mac
|
|
||||||
pinentry-touchid
|
|
||||||
vkquake
|
|
||||||
;
|
|
||||||
};
|
|
||||||
|
|
||||||
legacyPackages = {
|
|
||||||
wrapPackage = {
|
|
||||||
wrapper,
|
|
||||||
package,
|
|
||||||
exes ? [(lib.getExe package)],
|
|
||||||
}: let
|
|
||||||
wrapperExe = lib.getExe wrapper;
|
|
||||||
wrapExe = exe:
|
|
||||||
pkgs.writeShellScriptBin (builtins.baseNameOf exe) ''
|
|
||||||
exec ${wrapperExe} ${exe} "$@"
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
pkgs.symlinkJoin {
|
|
||||||
name = "${package.name}-${wrapper.name}";
|
|
||||||
paths = (map wrapExe exes) ++ [package];
|
|
||||||
};
|
|
||||||
|
|
||||||
wrapPackages = pkgsWrapperFn: pkgNames: final: prev: let
|
|
||||||
wrapper = pkgsWrapperFn final;
|
|
||||||
in
|
|
||||||
builtins.listToAttrs (map
|
|
||||||
(name: {
|
|
||||||
inherit name;
|
|
||||||
value = config.legacyPackages.wrapPackage {
|
|
||||||
inherit wrapper;
|
|
||||||
package = prev.${name};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
pkgNames);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
60
flake.nix
60
flake.nix
|
@ -29,10 +29,21 @@
|
||||||
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs:
|
outputs = {
|
||||||
|
flake-parts,
|
||||||
|
home-manager,
|
||||||
|
nixpkgs,
|
||||||
|
pre-commit-hooks,
|
||||||
|
darwin,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
} @ inputs: let
|
||||||
|
globals = import ./common/globals.nix;
|
||||||
|
in
|
||||||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
imports = [
|
imports = [
|
||||||
./flake-parts
|
./flake/home-manager.nix
|
||||||
|
./flake/overlays.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
systems = [
|
systems = [
|
||||||
|
@ -42,10 +53,55 @@
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
flake = let
|
||||||
|
mkSystem = type: system: definition: (type {
|
||||||
|
inherit system;
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs globals;
|
||||||
|
overlays = self.overlays;
|
||||||
|
};
|
||||||
|
modules = [definition];
|
||||||
|
});
|
||||||
|
|
||||||
|
mkNixos = arch: (mkSystem nixpkgs.lib.nixosSystem "${arch}-linux");
|
||||||
|
mkDarwin = arch: (mkSystem darwin.lib.darwinSystem "${arch}-darwin");
|
||||||
|
|
||||||
|
mkHome = system: config: (home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
specialArgs = {
|
||||||
|
inherit globals inputs;
|
||||||
|
overlays = self.overlays;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
{nix.package = nixpkgs.legacyPackages.${system}.nix;}
|
||||||
|
config
|
||||||
|
];
|
||||||
|
});
|
||||||
|
in rec {
|
||||||
|
nixosConfigurations.x86_64-live = mkNixos "x86_64" ./nixos/hosts/x86_64-live.nix;
|
||||||
|
nixosConfigurations.aarch64-live = mkNixos "aarch64" ./nixos/hosts/aarch64-live.nix;
|
||||||
|
|
||||||
|
nixosConfigurations.nixbox = mkNixos "x86_64" ./nixos/hosts/nixbox.nix;
|
||||||
|
|
||||||
|
nixosConfigurations.darwin-arm-minimal-vm = mkNixos "aarch64" ./nixos/hosts/vms/aarch64-darwin-host/minimal.nix;
|
||||||
|
nixosConfigurations.darwin-arm-homeconsole-vm = mkNixos "aarch64" ./nixos/hosts/vms/aarch64-darwin-host/home-console.nix;
|
||||||
|
|
||||||
|
darwinConfigurations.zeus = mkDarwin "aarch64" ./nixos/hosts/zeus.nix;
|
||||||
|
|
||||||
|
homeConfigurations.willem-darwin = mkHome "aarch64-darwin" ./home/darwin/default.nix;
|
||||||
|
homeConfigurations.willem-linux = mkHome "aarch64-linux" ./home/linux/default.nix;
|
||||||
|
|
||||||
|
packages.aarch64-darwin.minimal-vm = self.nixosConfigurations.darwin-arm-minimal-vm.config.system.build.vm;
|
||||||
|
packages.aarch64-darwin.homeconsole-vm = self.nixosConfigurations.darwin-arm-homeconsole-vm.config.system.build.vm;
|
||||||
|
packages.x86_64-linux.live-image = self.nixosConfigurations.x86_64-live.config.system.build.isoImage;
|
||||||
|
packages.aarch64-linux.live-image = self.nixosConfigurations.x86_64-live.config.system.build.isoImage;
|
||||||
|
};
|
||||||
|
|
||||||
perSystem = {
|
perSystem = {
|
||||||
system,
|
system,
|
||||||
self',
|
self',
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
checks.pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
checks.pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
# Copyright (c) 2018 Terje Larsen
|
|
||||||
# This work is licensed under the terms of the MIT license.
|
|
||||||
# For a copy, see https://opensource.org/licenses/MIT.
|
|
||||||
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/home-manager/default.nix
|
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
flake-parts-lib,
|
flake-parts-lib,
|
||||||
|
@ -15,12 +11,10 @@
|
||||||
;
|
;
|
||||||
inherit (flake-parts-lib) mkSubmoduleOptions;
|
inherit (flake-parts-lib) mkSubmoduleOptions;
|
||||||
in {
|
in {
|
||||||
imports = [./configurations.nix ./modules.nix ./users.nix];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
flake = mkSubmoduleOptions {
|
flake = mkSubmoduleOptions {
|
||||||
homeManagerModules = mkOption {
|
homeManagerModules = mkOption {
|
||||||
type = types.lazyAttrsOf types.unspecified;
|
type = types.attrsOf types.unspecified;
|
||||||
default = {};
|
default = {};
|
||||||
apply = lib.mapAttrs (k: v: {
|
apply = lib.mapAttrs (k: v: {
|
||||||
_file = "${toString self.outPath}/flake.nix#homeManagerModules.${k}";
|
_file = "${toString self.outPath}/flake.nix#homeManagerModules.${k}";
|
|
@ -1,2 +0,0 @@
|
||||||
$mainMod = SUPER
|
|
||||||
bind = $mainMod, Q, exec, kitty
|
|
|
@ -4,6 +4,15 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
imports = [
|
||||||
|
../modules/nix/use-flake-pkgs.nix
|
||||||
|
../modules/nix/pkgs-config.nix
|
||||||
|
./finder.nix
|
||||||
|
./iterm2.nix
|
||||||
|
./keybinds.nix
|
||||||
|
./launchd.nix
|
||||||
|
];
|
||||||
|
|
||||||
home.file.".gnupg/gpg-agent.conf" = {
|
home.file.".gnupg/gpg-agent.conf" = {
|
||||||
text = ''
|
text = ''
|
||||||
pinentry-program "${pkgs.pinentry-touchid}/bin/pinentry-touchid"
|
pinentry-program "${pkgs.pinentry-touchid}/bin/pinentry-touchid"
|
|
@ -1,20 +1,31 @@
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
globals,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
emacsCommand = "emacsclient -c -nw";
|
emacsCommand = "emacsclient -c -nw";
|
||||||
in rec {
|
in rec {
|
||||||
|
imports = [
|
||||||
|
./modules/emacs.nix
|
||||||
|
./packages.nix
|
||||||
|
./programs/default.nix
|
||||||
|
];
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
|
username = globals.username;
|
||||||
|
|
||||||
stateVersion = "23.05";
|
stateVersion = "23.05";
|
||||||
|
|
||||||
keyboard = {
|
keyboard = {
|
||||||
layout = "us";
|
layout = globals.keyboard.layout;
|
||||||
variant = "colemak";
|
variant = globals.keyboard.variant;
|
||||||
};
|
};
|
||||||
|
|
||||||
language = {
|
language = {
|
||||||
base = "en_CA.UTF-8";
|
base = globals.language;
|
||||||
};
|
};
|
||||||
|
|
||||||
sessionVariables = rec {
|
sessionVariables = rec {
|
||||||
DOTDIR = "${config.home.homeDirectory}/.config/dotfiles.nix";
|
DOTDIR = "${config.home.homeDirectory}/.config/dotfiles.nix";
|
||||||
EDITOR = emacsCommand;
|
EDITOR = emacsCommand;
|
|
@ -1,9 +1,16 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
imports = [
|
||||||
|
../default.nix
|
||||||
|
./services.nix
|
||||||
|
./hyprland.nix
|
||||||
|
../modules/nix/pkgs-config.nix
|
||||||
|
../modules/nix/use-flake-pkgs.nix
|
||||||
|
];
|
||||||
|
|
||||||
programs.zsh.shellAliases = {
|
programs.zsh.shellAliases = {
|
||||||
nrs = "nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/dotfiles.nix#";
|
nrs = "nixos-rebuild switch --flake ${config.home.homeDirectory}/.config/dotfiles.nix#";
|
||||||
nbs = "nixos-rebuild build --flake ${config.home.homeDirectory}/.config/dotfiles.nix#";
|
nbs = "nixos-rebuild build --flake ${config.home.homeDirectory}/.config/dotfiles.nix#";
|
||||||
|
@ -12,4 +19,8 @@
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
gcc-arm-embedded
|
gcc-arm-embedded
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.homeDirectory = "/home/willem";
|
||||||
|
|
||||||
|
programs.emacs.enableOrgTex = false;
|
||||||
}
|
}
|
|
@ -6,7 +6,6 @@
|
||||||
}: {
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
alacritty
|
alacritty
|
||||||
discord
|
|
||||||
firefox
|
firefox
|
||||||
lxappearance
|
lxappearance
|
||||||
pipewire
|
pipewire
|
9
home/modules/nix/pkgs-config.nix
Normal file
9
home/modules/nix/pkgs-config.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
overlays,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
nixpkgs.config.allowUnfreePredicate = _: true;
|
||||||
|
nixpkgs.config.allowUnsupportedSystem = true;
|
||||||
|
nixpkgs.overlays = builtins.attrValues overlays;
|
||||||
|
}
|
4
home/modules/nix/use-flake-pkgs.nix
Normal file
4
home/modules/nix/use-flake-pkgs.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
home.sessionVariables.NIX_PATH = "nixpkgs=${inputs.nixpkgs}";
|
||||||
|
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||||
|
}
|
|
@ -4,6 +4,11 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
imports = [
|
||||||
|
./zsh.nix
|
||||||
|
./emacs
|
||||||
|
];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
bash.enableCompletion = true;
|
bash.enableCompletion = true;
|
||||||
|
|
8
nixos/hosts/aarch64-live.nix
Normal file
8
nixos/hosts/aarch64-live.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
../profiles/live-image.nix
|
||||||
|
../modules/apple-silicon.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "nixos-live-aarch64";
|
||||||
|
}
|
|
@ -7,6 +7,9 @@
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
../profiles/hyprland.nix
|
||||||
|
../profiles/default.nix
|
||||||
|
../modules/users/willem/home.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||||
|
|
6
nixos/hosts/vms/aarch64-darwin-host/home-console.nix
Normal file
6
nixos/hosts/vms/aarch64-darwin-host/home-console.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
../../../modules/users/willem/home.nix
|
||||||
|
./minimal.nix
|
||||||
|
];
|
||||||
|
}
|
8
nixos/hosts/vms/aarch64-darwin-host/minimal.nix
Normal file
8
nixos/hosts/vms/aarch64-darwin-host/minimal.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
../../../modules/users/willem/vm.nix
|
||||||
|
../../../modules/vm/headless.nix
|
||||||
|
../../../modules/vm/aarch64-darwin-host.nix
|
||||||
|
../../../profiles/default.nix
|
||||||
|
];
|
||||||
|
}
|
4
nixos/hosts/x86_64-live.nix
Normal file
4
nixos/hosts/x86_64-live.nix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
imports = [../profiles/live-image.nix];
|
||||||
|
networking.hostName = "nixos-live-x86_64";
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{...}: {
|
||||||
config.home-manager = {
|
config.home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
19
nixos/modules/users/willem/home.nix
Normal file
19
nixos/modules/users/willem/home.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
inputs,
|
||||||
|
globals,
|
||||||
|
overlays,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.willem = {
|
||||||
|
imports = [
|
||||||
|
inputs.nix-index-database.hmModules.nix-index
|
||||||
|
../../../../home/linux/default.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.extraSpecialArgs = {inherit inputs overlays globals;};
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
imports = [./willem.nix];
|
imports = [./default.nix];
|
||||||
users.users.willem.hashedPassword = "";
|
users.users.willem.hashedPassword = "";
|
||||||
services.getty.autologinUser = "willem";
|
services.getty.autologinUser = "willem";
|
||||||
}
|
}
|
3
nixos/modules/vm/aarch64-darwin-host.nix
Normal file
3
nixos/modules/vm/aarch64-darwin-host.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
virtualisation.host.pkgs = inputs.nixpkgs.legacyPackages.aarch64-darwin;
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
imports = [./vm.nix];
|
imports = [./default.nix];
|
||||||
virtualisation.vmVariant.virtualisation.graphics = false;
|
virtualisation.vmVariant.virtualisation.graphics = false;
|
||||||
virtualisation.graphics = false;
|
virtualisation.graphics = false;
|
||||||
}
|
}
|
|
@ -1,5 +1,15 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
imports = [../common.nix];
|
inputs,
|
||||||
|
overlays,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
../../common/system.nix
|
||||||
|
../modules/nix/use-flake-pkgs.nix
|
||||||
|
../modules/users/willem/default.nix
|
||||||
|
inputs.nix-index-database.nixosModules.nix-index
|
||||||
|
];
|
||||||
|
|
||||||
console.keyMap = "colemak";
|
console.keyMap = "colemak";
|
||||||
console.packages = [pkgs.terminus_font];
|
console.packages = [pkgs.terminus_font];
|
||||||
|
@ -20,5 +30,8 @@
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.05";
|
||||||
|
|
||||||
|
nixpkgs.overlays = builtins.attrValues overlays;
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
}
|
}
|
|
@ -1,10 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
pkgs,
|
||||||
freecad
|
globals,
|
||||||
qbittorrent
|
...
|
||||||
vlc
|
}: {
|
||||||
];
|
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
|
@ -19,11 +17,10 @@
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
layout = globals.keyboard.layout;
|
||||||
layout = "us";
|
|
||||||
libinput.mouse.naturalScrolling = true;
|
libinput.mouse.naturalScrolling = true;
|
||||||
libinput.touchpad.naturalScrolling = true;
|
libinput.touchpad.naturalScrolling = true;
|
||||||
xkbVariant = "colemak";
|
xkbVariant = globals.keyboard.variant;
|
||||||
};
|
};
|
||||||
|
|
||||||
sound.enable = true;
|
sound.enable = true;
|
|
@ -8,7 +8,6 @@
|
||||||
])
|
])
|
||||||
++ (with pkgs.gnome; [
|
++ (with pkgs.gnome; [
|
||||||
gnome-music
|
gnome-music
|
||||||
geary # email reader
|
|
||||||
evince # document viewer
|
evince # document viewer
|
||||||
gnome-characters
|
gnome-characters
|
||||||
totem # video player
|
totem # video player
|
||||||
|
@ -23,6 +22,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
displayManager.gdm.enable = true;
|
displayManager.gdm.enable = true;
|
||||||
desktopManager.gnome.enable = true;
|
desktopManager.gnome.enable = true;
|
||||||
};
|
};
|
|
@ -3,8 +3,16 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
imports = [./desktop.nix];
|
||||||
|
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{wayland.windowManager.hyprland.enable = true;}
|
||||||
|
inputs.hyprland.homeManagerModules.default
|
||||||
|
];
|
||||||
|
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland.enable = true;
|
||||||
programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
substituters = ["https://hyprland.cachix.org"];
|
substituters = ["https://hyprland.cachix.org"];
|
||||||
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
|
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
programs.hyprland.enable = true;
|
|
||||||
programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
|
||||||
nix.settings = {
|
|
||||||
substituters = ["https://hyprland.cachix.org"];
|
|
||||||
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -6,11 +6,11 @@
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
|
||||||
(modulesPath + "/profiles/minimal.nix")
|
(modulesPath + "/profiles/minimal.nix")
|
||||||
|
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
||||||
(modulesPath + "/profiles/installation-device.nix")
|
(modulesPath + "/profiles/installation-device.nix")
|
||||||
|
./default.nix
|
||||||
];
|
];
|
||||||
networking.hostName = "nixos-live";
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
curl
|
curl
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
efivar
|
efivar
|
||||||
fuse
|
fuse
|
||||||
fuse3
|
fuse3
|
||||||
|
git
|
||||||
gptfdisk
|
gptfdisk
|
||||||
hdparm
|
hdparm
|
||||||
ms-sys
|
ms-sys
|
|
@ -1,94 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
fetchFromGitHub,
|
|
||||||
meson,
|
|
||||||
ninja,
|
|
||||||
pkg-config,
|
|
||||||
python3,
|
|
||||||
qtbase,
|
|
||||||
qtsvg,
|
|
||||||
qttools,
|
|
||||||
radare2,
|
|
||||||
wrapQtAppsHook,
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "iaito";
|
|
||||||
version = "5.8.4";
|
|
||||||
|
|
||||||
srcs = [
|
|
||||||
(fetchFromGitHub rec {
|
|
||||||
owner = "radareorg";
|
|
||||||
repo = "iaito";
|
|
||||||
rev = version;
|
|
||||||
hash = "sha256-pt2vq+JN+Ccv+9o8s2y87xTVeQp2WJ0UfKdoWGsBkUI=";
|
|
||||||
name = repo;
|
|
||||||
})
|
|
||||||
(fetchFromGitHub rec {
|
|
||||||
owner = "radareorg";
|
|
||||||
repo = "iaito-translations";
|
|
||||||
rev = "e66b3a962a7fc7dfd730764180011ecffbb206bf";
|
|
||||||
hash = "sha256-6NRTZ/ydypsB5TwbivvwOH9TEMAff/LH69hCXTvMPp8=";
|
|
||||||
name = repo;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
sourceRoot = "iaito/src";
|
|
||||||
|
|
||||||
postUnpack = ''
|
|
||||||
chmod -R u+w iaito-translations
|
|
||||||
'';
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace common/ResourcePaths.cpp \
|
|
||||||
--replace "/app/share/iaito/translations" "$out/share/iaito/translations"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
meson
|
|
||||||
ninja
|
|
||||||
pkg-config
|
|
||||||
python3
|
|
||||||
qttools
|
|
||||||
wrapQtAppsHook
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
qtbase
|
|
||||||
qtsvg
|
|
||||||
radare2
|
|
||||||
];
|
|
||||||
|
|
||||||
postBuild = ''
|
|
||||||
pushd ../../../iaito-translations
|
|
||||||
make build PREFIX=$out
|
|
||||||
popd
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
install -m755 -Dt $out/bin iaito
|
|
||||||
install -m644 -Dt $out/share/metainfo ../org.radare.iaito.appdata.xml
|
|
||||||
install -m644 -Dt $out/share/applications ../org.radare.iaito.desktop
|
|
||||||
install -m644 -Dt $out/share/pixmaps ../img/iaito-o.svg
|
|
||||||
|
|
||||||
pushd ../../../iaito-translations
|
|
||||||
make install PREFIX=$out -j$NIX_BUILD_CORES
|
|
||||||
popd
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "An official graphical interface of radare2";
|
|
||||||
longDescription = ''
|
|
||||||
iaito is the official graphical interface of radare2. It's the
|
|
||||||
continuation of Cutter for radare2 after the Rizin fork.
|
|
||||||
'';
|
|
||||||
homepage = "https://radare.org/n/iaito.html";
|
|
||||||
changelog = "https://github.com/radareorg/iaito/releases/tag/${version}";
|
|
||||||
license = licenses.gpl3Plus;
|
|
||||||
maintainers = with maintainers; [azahi];
|
|
||||||
platforms = platforms.all;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
fetchFromGitHub,
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "vkquake";
|
|
||||||
name = "vkQuake";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "Novum";
|
|
||||||
repo = "vkQuake";
|
|
||||||
rev = "98e9e1c76e4ea57d6960c8b4c67a72f7f50f45ea";
|
|
||||||
sha256 = "sha256-XMsvc9886eYI+CzBMckop7WCAulm2qlKdNu+3qDK7zY=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
|
||||||
meson
|
|
||||||
pkgconfig
|
|
||||||
python3
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
darwin.binutils
|
|
||||||
ripgrep
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
vulkan-headers
|
|
||||||
glslang
|
|
||||||
spirv-tools
|
|
||||||
SDL2
|
|
||||||
libvorbis
|
|
||||||
flac
|
|
||||||
libopus
|
|
||||||
opusfile
|
|
||||||
flac
|
|
||||||
libmad
|
|
||||||
darwin.moltenvk
|
|
||||||
];
|
|
||||||
|
|
||||||
macApp = ./vkQuake.app;
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
# -*-sh-*-
|
|
||||||
cp -r $src/* .
|
|
||||||
meson build && ninja -C build
|
|
||||||
cp -r $macApp vkQuake.app
|
|
||||||
chmod -R a+rw vkQuake.app
|
|
||||||
ls
|
|
||||||
cp build/vkquake vkQuake.app/Contents/Resources/vkquake
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
mv build/vkquake $out/bin/vkquake
|
|
||||||
mv vkQuake.app $out/Applications/.
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>q1-launcher.sh</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>vkQuake</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>APPL</string>
|
|
||||||
<key>CFBundleIconFile</key>
|
|
||||||
<string>vkquake.icns</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>5.00</string>
|
|
||||||
<key>NSHumanReadableCopyright</key>
|
|
||||||
<string>id Software</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# setting the right directories
|
|
||||||
BASEDIR="$( cd "$(dirname "$0")" || exit; pwd )"
|
|
||||||
RESOURCESDIR="$( cd "$BASEDIR/../Resources" || exit; pwd )"
|
|
||||||
FRAMEWORKSDIR="$( cd "$BASEDIR/../Frameworks" || exit; pwd )"
|
|
||||||
|
|
||||||
BIN="$RESOURCESDIR/vkquake"
|
|
||||||
|
|
||||||
export DYLD_FALLBACK_LIBRARY_PATH="$FRAMEWORKSDIR"
|
|
||||||
|
|
||||||
QUAKEDIR="$(if [[ -e "$RESOURCESDIR/id1" ]]; then echo "$RESOURCESDIR"; else echo "$HOME/.baseq1"; fi)"
|
|
||||||
|
|
||||||
$BIN -basedir $QUAKEDIR
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue