Skip to content

Commit

Permalink
fmt + cryptoshop
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Aug 26, 2024
1 parent bb646d6 commit 03d9222
Show file tree
Hide file tree
Showing 38 changed files with 394 additions and 396 deletions.
243 changes: 123 additions & 120 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,127 +36,130 @@

# In this context, outputs are mostly about getting home-manager what it
# needs since it will be the one using the flake
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
flake-utils,
...
} @ inputs: let
inherit (self) outputs;

# Legacy packages are needed for home-manager
lib = nixpkgs.lib // home-manager.lib;

# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];

# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;

# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});

# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
pkgsFor = lib.genAttrs systems (system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
});

# Define a development shell for each system
devShellFor = system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
outputs =
{ self
, nixpkgs
, nixpkgs-unstable
, home-manager
, flake-utils
, ...
} @ inputs:
let
inherit (self) outputs;

# Legacy packages are needed for home-manager
lib = nixpkgs.lib // home-manager.lib;

# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];

# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;

# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});

# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
pkgsFor = lib.genAttrs systems (system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
});

# Define a development shell for each system
devShellFor = system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes repl-flake";
buildInputs = with pkgs; [
nix
nil
git
nixd
just
nixpkgs-fmt
nixpkgs-lint
];

# Set environment variables, if needed
shellHook = ''
# export SOME_VAR=some_value
echo "Welcome to Kolyma's dotfiles!"
'';
};
in
pkgs.mkShell {
NIX_CONFIG = "extra-experimental-features = nix-command flakes repl-flake";
buildInputs = with pkgs; [
nix
nil
git
nixd
just
nixpkgs-fmt
nixpkgs-lint
];

# Set environment variables, if needed
shellHook = ''
# export SOME_VAR=some_value
echo "Welcome to Kolyma's dotfiles!"
'';
};
in {
inherit lib;

# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;});

# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter =
forAllSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);

# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};

# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;

# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home;

# Reusable server modules you might want to export
# These are usually stuff you would upstream services to global
serverModules = import ./modules/server;

# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
# homeManagerModules = import ./modules/home;

# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
"Kolyma-1" = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
# > Our main nixos configuration file <
./nixos/kolyma-1/configuration.nix
];
};
"Kolyma-2" = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
# > Our main nixos configuration file <
./nixos/kolyma-2/configuration.nix
];
};
"Kolyma-3" = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
# > Our main nixos configuration file <
./nixos/kolyma-3/configuration.nix
];
{
inherit lib;

# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });

# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter =
forAllSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);

# Your custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs; };

# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;

# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home;

# Reusable server modules you might want to export
# These are usually stuff you would upstream services to global
serverModules = import ./modules/server;

# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
# homeManagerModules = import ./modules/home;

# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
"Kolyma-1" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
# > Our main nixos configuration file <
./nixos/kolyma-1/configuration.nix
];
};
"Kolyma-2" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
# > Our main nixos configuration file <
./nixos/kolyma-2/configuration.nix
];
};
"Kolyma-3" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
modules = [
# > Our main nixos configuration file <
./nixos/kolyma-3/configuration.nix
];
};
};
};

# Development shells
devShell = lib.mapAttrs (system: _: devShellFor system) (lib.genAttrs systems {});
# devShells = lib.mapAttrs (system: _: devShellFor system) (lib.genAttrs systems {});
};
# Development shells
devShell = lib.mapAttrs (system: _: devShellFor system) (lib.genAttrs systems { });
# devShells = lib.mapAttrs (system: _: devShellFor system) (lib.genAttrs systems {});
};
}
17 changes: 8 additions & 9 deletions home/muzaffar.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
inputs,
lib,
pkgs,
config,
outputs,
packages,
self,
...
{ inputs
, lib
, pkgs
, config
, outputs
, packages
, self
, ...
}: {
imports = [
outputs.homeManagerModules.zsh
Expand Down
17 changes: 8 additions & 9 deletions home/sakhib.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
inputs,
lib,
pkgs,
config,
outputs,
packages,
self,
...
{ inputs
, lib
, pkgs
, config
, outputs
, packages
, self
, ...
}: {
imports = [
outputs.homeManagerModules.zsh
Expand Down
17 changes: 8 additions & 9 deletions home/shakhzod.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
inputs,
lib,
pkgs,
config,
outputs,
packages,
self,
...
{ inputs
, lib
, pkgs
, config
, outputs
, packages
, self
, ...
}: {
imports = [
outputs.homeManagerModules.zsh
Expand Down
2 changes: 1 addition & 1 deletion modules/home/nixpkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{outputs, ...}: {
{ outputs, ... }: {
config = {
nixpkgs = {
# You can add overlays here
Expand Down
15 changes: 8 additions & 7 deletions modules/home/packages/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
config,
pkgs,
lib,
...
}: let
{ config
, pkgs
, lib
, ...
}:
let
linux = with pkgs; [
# Add new packages here
docker-compose
Expand Down Expand Up @@ -59,7 +59,8 @@
# Selfmade programs
fp
];
in {
in
{
config = {
# Packages to be installed on my machine
home.packages = globals ++ linux;
Expand Down
6 changes: 3 additions & 3 deletions modules/home/topgrade/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
config = {
programs.topgrade = {
enable = true;
Expand All @@ -17,10 +17,10 @@
assume_yes = true;
no_self_update = true;
};
commands = {};
commands = { };
linux = {
nix_arguments = "--flake github:kolyma-labs/instances";
home_manager_arguments = ["--flake" "github:kolyma-labs/instances"];
home_manager_arguments = [ "--flake" "github:kolyma-labs/instances" ];
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion modules/home/zsh/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
imports = [
./zoxide.nix
./starship.nix
Expand Down
2 changes: 1 addition & 1 deletion modules/home/zsh/starship.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
# Prettier terminal prompt
programs.starship = {
enable = true;
Expand Down
2 changes: 1 addition & 1 deletion modules/home/zsh/zoxide.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
# Zpxide path integration
programs.zoxide = {
enable = true;
Expand Down
Loading

0 comments on commit 03d9222

Please sign in to comment.