This commit is contained in:
sadan 2024-12-18 18:54:34 -05:00
parent 7dd6913f08
commit 0a7223bd6b
No known key found for this signature in database
6 changed files with 176 additions and 101 deletions

View file

@ -21,7 +21,7 @@ in
../../../../customPackages ../../../../customPackages
]; ];
home = { home = {
packages = with pkgs; [ packages = [
# env for clipboard command will be required by their respective environemnts # env for clipboard command will be required by their respective environemnts
(mkScript { (mkScript {
name = "paste"; name = "paste";
@ -34,12 +34,12 @@ in
(mkScript { (mkScript {
name = "http2ssh"; name = "http2ssh";
file = ./http2ssh.sh; file = ./http2ssh.sh;
env = [git]; env = [pkgs.git];
}) })
(mkScript { (mkScript {
name = "git_fetchAll"; name = "git_fetchAll";
file = ./git_fetchAll.sh; file = ./git_fetchAll.sh;
env = [git]; env = [pkgs.git];
}) })
(mkScript { (mkScript {
name = "install_eslint"; name = "install_eslint";
@ -48,12 +48,17 @@ in
(mkScript { (mkScript {
name = "math"; name = "math";
file = ./math.sh; file = ./math.sh;
env = [python3]; env = [pkgs.python3];
}) })
(mkScript { (mkScript {
name = "hashi18n"; name = "hashi18n";
file = ./hashi18n.sh; file = ./hashi18n.sh;
}) })
(mkScript {
name = "flakeify";
file = ./flakeify.sh;
deps = [pkgs.direnv];
})
]; ];
file = { file = {
scripts = { scripts = {

View file

@ -0,0 +1,7 @@
if [ ! -e flake.nix ]; then
nix flake new -t github:nix-community/nix-direnv .
elif [ ! -e .envrc ]; then
echo "use flake" > .envrc
direnv allow
fi
${EDITOR:-vim} flake.nix

View file

@ -27,6 +27,13 @@ in
}; };
}; };
programs = { programs = {
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv = {
enable = true;
};
};
zoxide = { zoxide = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;

View file

@ -1,9 +1,7 @@
{ {
config,
pkgs,
inputs,
... ...
}: { }:
{
nixpkgs.config.allowInsecurePredicate = (pkg: true); nixpkgs.config.allowInsecurePredicate = (pkg: true);
nixpkgs.config.allowUnfreePredicate = (pkg: true); nixpkgs.config.allowUnfreePredicate = (pkg: true);

View file

@ -244,6 +244,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -506,6 +524,18 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1733096140,
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1730200266, "lastModified": 1730200266,
@ -541,6 +571,7 @@
"root": { "root": {
"inputs": { "inputs": {
"chrome-pak": "chrome-pak", "chrome-pak": "chrome-pak",
"flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"home-manager-stable": "home-manager-stable", "home-manager-stable": "home-manager-stable",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",

213
flake.nix
View file

@ -37,112 +37,139 @@
url = "git+file:./customPackages/chrome-pak-customizer"; url = "git+file:./customPackages/chrome-pak-customizer";
flake = false; flake = false;
}; };
flake-parts.url = "github:hercules-ci/flake-parts";
}; };
outputs = outputs =
{ self
, nixpkgs
, nixos-wsl
, nix-stable
, ...
}@inputs:
# let
# boxes = [
# "default"
# ];
# forAllSystems = nixpkgs.lib.genAttrs boxes;
# in
{ {
nixosConfigurations = { self,
desktopIso = nixpkgs.lib.nixosSystem { nixpkgs,
system = "aarch64-linux"; nixos-wsl,
modules = [ nix-stable,
( flake-parts,
{ pkgs ...
, modulesPath }@inputs:
, lib flake-parts.lib.mkFlake { inherit inputs; } {
, ... debug = true;
}: systems = [ "x86_64-linux" ];
perSystem = { config, ... }: { };
flake = {
homeConfigurations = {
nixd = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
{ {
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ]; home = {
boot.kernelPackages = pkgs.linuxPackages_latest; stateVersion = "24.05";
boot.supportedFilesystems = lib.mkForce [ username = "nixd";
"btrfs" homeDirectory = "/dev/null";
"reiserfs"
"vfat"
"f2fs"
"xfs"
"ntfs"
"cifs"
"ext4"
];
}
)
];
};
nix-desktop-evo4b5 = nixpkgs.lib.nixosSystem rec {
specialArgs = {
inherit inputs;
stable = import nix-stable {
inherit system;
config = {
allowUnfree = true;
};
};
};
system = "x86_64-linux";
modules = [
(
{ pkgs, ... }:
{
_module.args = {
unstable = pkgs;
}; };
} }
) (
./boxes/desktop/configuration.nix { pkgs, ... }:
inputs.home-manager.nixosModules.default {
inputs.nix-index-database.nixosModules.nix-index wayland.windowManager.hyprland.enable = true;
{ programs.nix-index-database.comma.enable = true; } home = {
]; packages = with pkgs; [ nixd ];
};
}
)
];
};
}; };
arm-laptop-evo4b5 = nix-stable.lib.nixosSystem rec { nixosConfigurations = {
system = "aarch64-linux"; nixd = nixpkgs.lib.nixosSystem { };
specialArgs = { desktopIso = nixpkgs.lib.nixosSystem {
inputs = inputs // { system = "aarch64-linux";
nixpkgs = nix-stable; modules = [
home-manager = inputs.home-manager-stable; (
stylix = inputs.stylix-stable; {
}; pkgs,
unstable = import nixpkgs { modulesPath,
inherit system; lib,
config = { ...
allowUnfree = true; }:
{
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.supportedFilesystems = lib.mkForce [
"btrfs"
"reiserfs"
"vfat"
"f2fs"
"xfs"
"ntfs"
"cifs"
"ext4"
];
}
)
];
};
nix-desktop-evo4b5 = nixpkgs.lib.nixosSystem rec {
specialArgs = {
inherit inputs;
stable = import nix-stable {
inherit system;
config = {
allowUnfree = true;
};
}; };
}; };
system = "x86_64-linux";
modules = [
(
{ pkgs, ... }:
{
_module.args = {
unstable = pkgs;
};
}
)
./boxes/desktop/configuration.nix
inputs.home-manager.nixosModules.default
inputs.nix-index-database.nixosModules.nix-index
{ programs.nix-index-database.comma.enable = true; }
];
}; };
modules = [ arm-laptop-evo4b5 = nix-stable.lib.nixosSystem rec {
( system = "aarch64-linux";
{ pkgs, ... }: specialArgs = {
{ inputs = inputs // {
_module.args = { nixpkgs = nix-stable;
stable = pkgs; home-manager = inputs.home-manager-stable;
stylix = inputs.stylix-stable;
};
unstable = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
}; };
} };
) };
./boxes/wsl/configuration.nix modules = [
inputs.home-manager-stable.nixosModules.default (
nixos-wsl.nixosModules.wsl { pkgs, ... }:
]; {
_module.args = {
stable = pkgs;
};
}
)
./boxes/wsl/configuration.nix
inputs.home-manager-stable.nixosModules.default
nixos-wsl.nixosModules.wsl
];
};
}; };
# nixosConfigurations.default = nixpkgs.lib.nixosSystem {
# specialArgs = {inherit inputs;};
# modules = [
# ./boxes/desktop/configuration.nix
# inputs.home-manager.nixosModules.default
# ];
# };
# cpkg = forAllSystems(system: import ./customPackages);
}; };
# nixosConfigurations.default = nixpkgs.lib.nixosSystem {
# specialArgs = {inherit inputs;};
# modules = [
# ./boxes/desktop/configuration.nix
# inputs.home-manager.nixosModules.default
# ];
# };
# cpkg = forAllSystems(system: import ./customPackages);
}; };
} }