Compare commits
6 Commits
c4e5b0141f
...
5c3b923653
Author | SHA1 | Date |
---|---|---|
Zynh Ludwig | 5c3b923653 | |
Zynh Ludwig | 8039eacfb9 | |
Zynh Ludwig | 6af247c6c6 | |
Zynh Ludwig | 89e5cb8679 | |
Zynh Ludwig | 2d2909e22e | |
Zynh Ludwig | 73504959a2 |
|
@ -59,6 +59,7 @@
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
homeConfigurations =
|
homeConfigurations =
|
||||||
builders.compileHomes
|
builders.compileHomes
|
||||||
[
|
[
|
||||||
|
@ -78,5 +79,7 @@
|
||||||
system = "aarch64-darwin";
|
system = "aarch64-darwin";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
overlays.default = import ./pkgs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ lib, self, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
getModules = path:
|
getModules = path:
|
||||||
|
@ -16,6 +16,7 @@ in
|
||||||
imports = getModules ./.;
|
imports = getModules ./.;
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nixpkgs.overlays = [ self.overlays.default ];
|
||||||
|
|
||||||
snowhawk.user.enable = lib.mkDefault true;
|
snowhawk.user.enable = lib.mkDefault true;
|
||||||
snowhawk.tmux.enable = lib.mkDefault true;
|
snowhawk.tmux.enable = lib.mkDefault true;
|
||||||
|
|
|
@ -6,6 +6,8 @@ in
|
||||||
{
|
{
|
||||||
options.snowhawk.xivlauncher = {
|
options.snowhawk.xivlauncher = {
|
||||||
enable = lib.mkEnableOption "xivlauncher home-manager module";
|
enable = lib.mkEnableOption "xivlauncher home-manager module";
|
||||||
|
|
||||||
|
textools.enable = lib.mkEnableOption "TexTools wine application";
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config =
|
||||||
|
|
|
@ -100,9 +100,6 @@
|
||||||
# backupFileExtension = "backup";
|
# backupFileExtension = "backup";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allow unfree packages
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# programs.hyprland.enable = true;
|
# programs.hyprland.enable = true;
|
||||||
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running `nixos-help`).
|
# and in the NixOS manual (accessible by running `nixos-help`).
|
||||||
|
|
||||||
{ pkgs, inputs, lib, config, ... }:
|
{ pkgs, inputs, lib, config, self, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs self; };
|
||||||
users = { "ravenshade" = import ./home.nix; };
|
users = { "ravenshade" = import ./home.nix; };
|
||||||
# backupFileExtension = "backup";
|
# backupFileExtension = "backup";
|
||||||
};
|
};
|
||||||
|
|
|
@ -102,9 +102,6 @@
|
||||||
# backupFileExtension = "backup";
|
# backupFileExtension = "backup";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allow unfree packages
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
# programs.hyprland.enable = true;
|
# programs.hyprland.enable = true;
|
||||||
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ nixpkgs, ... }@inputs:
|
{ nixpkgs, self, ... }@inputs:
|
||||||
|
|
||||||
let
|
let
|
||||||
lib = nixpkgs.lib.extend (import ../lib);
|
lib = nixpkgs.lib.extend (import ../lib);
|
||||||
|
@ -15,7 +15,7 @@ rec {
|
||||||
hostname
|
hostname
|
||||||
(nixosSystem {
|
(nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit inputs lib; };
|
specialArgs = { inherit inputs lib self; };
|
||||||
modules = [
|
modules = [
|
||||||
../hosts/${hostname}/hardware-configuration.nix
|
../hosts/${hostname}/hardware-configuration.nix
|
||||||
../hosts/${hostname}/configuration.nix
|
../hosts/${hostname}/configuration.nix
|
||||||
|
@ -39,9 +39,9 @@ rec {
|
||||||
nameValuePair
|
nameValuePair
|
||||||
"${user}${hostStr}"
|
"${user}${hostStr}"
|
||||||
(homeManagerConfiguration {
|
(homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages."${system}";
|
pkgs = nixpkgs.legacyPackages.${system}.extend self.overlays.default;
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit inputs self;
|
||||||
lib = lib.extend inputs.home-manager.lib;
|
lib = lib.extend inputs.home-manager.lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,5 @@ in
|
||||||
snowhawk.audio.enable = lib.mkDefault true;
|
snowhawk.audio.enable = lib.mkDefault true;
|
||||||
snowhawk.env.enable = lib.mkDefault true;
|
snowhawk.env.enable = lib.mkDefault true;
|
||||||
snowhawk.sops.enable = lib.mkDefault true;
|
snowhawk.sops.enable = lib.mkDefault true;
|
||||||
|
snowhawk.nixpkgs.enable = lib.mkDefault true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,5 @@ in
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, config, self, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.snowhawk.nixpkgs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.snowhawk.nixpkgs = {
|
||||||
|
enable = lib.mkEnableOption "nixpkgs settings";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
nixpkgs.overlays = [ self.overlays.default ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
final: prev:
|
||||||
|
{
|
||||||
|
wrapWine = prev.lib.callPackage ./wrapWine.nix { };
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
# Yoink https://github.com/h4ckbs/lan-party-netboot/blob/master/wrapWine.nix
|
||||||
|
|
||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
inherit (builtins) length concatStringsSep;
|
||||||
|
inherit (pkgs) lib cabextract writeShellScriptBin;
|
||||||
|
inherit (lib) makeBinPath;
|
||||||
|
in
|
||||||
|
{ is64bits ? false
|
||||||
|
, wine ? if is64bits then pkgs.wineWowPackages.stable else pkgs.wine
|
||||||
|
, wineFlags ? ""
|
||||||
|
, executable
|
||||||
|
, chdir ? null
|
||||||
|
, name
|
||||||
|
, tricks ? [ ]
|
||||||
|
, setupScript ? ""
|
||||||
|
, firstrunScript ? ""
|
||||||
|
, home ? ""
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
wineBin = "${wine}/bin/wine${if is64bits then "64" else ""}";
|
||||||
|
requiredPackages = [
|
||||||
|
wine
|
||||||
|
cabextract
|
||||||
|
];
|
||||||
|
WINENIX_PROFILES = "$HOME/WINENIX_PROFILES";
|
||||||
|
PATH = makeBinPath requiredPackages;
|
||||||
|
NAME = name;
|
||||||
|
HOME =
|
||||||
|
if home == ""
|
||||||
|
then "${WINENIX_PROFILES}/${name}"
|
||||||
|
else home;
|
||||||
|
WINEARCH =
|
||||||
|
if is64bits
|
||||||
|
then "win64"
|
||||||
|
else "win32";
|
||||||
|
setupHook = ''
|
||||||
|
${wine}/bin/wineboot
|
||||||
|
'';
|
||||||
|
tricksHook =
|
||||||
|
if (length tricks) > 0 then
|
||||||
|
let
|
||||||
|
tricksStr = concatStringsSep " " tricks;
|
||||||
|
tricksCmd = ''
|
||||||
|
pushd $(mktemp -d)
|
||||||
|
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
|
||||||
|
chmod +x winetricks
|
||||||
|
./winetricks ${tricksStr}
|
||||||
|
popd
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
tricksCmd
|
||||||
|
else "";
|
||||||
|
script = writeShellScriptBin name ''
|
||||||
|
export APP_NAME="${NAME}"
|
||||||
|
export WINEARCH=${WINEARCH}
|
||||||
|
export WINE_NIX="$HOME/.wine-nix" # define antes de definir $HOME senão ele vai gravar na nova $HOME a .wine-nix
|
||||||
|
export WINE_NIX_PROFILES="${WINENIX_PROFILES}"
|
||||||
|
export PATH=$PATH:${PATH}
|
||||||
|
export HOME="${HOME}"
|
||||||
|
mkdir -p "$HOME"
|
||||||
|
export WINEPREFIX="$WINE_NIX/${name}"
|
||||||
|
export EXECUTABLE="${executable}"
|
||||||
|
mkdir -p "$WINE_NIX" "$WINE_NIX_PROFILES"
|
||||||
|
${setupScript}
|
||||||
|
if [ ! -d "$WINEPREFIX" ] # if the prefix does not exist
|
||||||
|
then
|
||||||
|
${setupHook}
|
||||||
|
# ${wineBin} cmd /c dir > /dev/null 2> /dev/null # initialize prefix
|
||||||
|
wineserver -w
|
||||||
|
${tricksHook}
|
||||||
|
rm "$WINEPREFIX/drive_c/users/$USER" -rf
|
||||||
|
ln -s "$HOME" "$WINEPREFIX/drive_c/users/$USER"
|
||||||
|
${firstrunScript}
|
||||||
|
fi
|
||||||
|
${if chdir != null
|
||||||
|
then ''cd "${chdir}"''
|
||||||
|
else ""}
|
||||||
|
if [ ! "$REPL" == "" ]; # if $REPL is setup then start a shell in the context
|
||||||
|
then
|
||||||
|
bash
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
${wineBin} ${wineFlags} "$EXECUTABLE" "$@"
|
||||||
|
wineserver -w
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
script
|
Loading…
Reference in New Issue