Skip to content

Commit

Permalink
add flake for user, edit glf flake for expose module.
Browse files Browse the repository at this point in the history
  • Loading branch information
CORAAL committed Jan 5, 2025
1 parent 26c9b81 commit ae8587c
Show file tree
Hide file tree
Showing 35 changed files with 748 additions and 493 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ iso:
nix --extra-experimental-features "nix-command flakes" build -L .#iso

build-vm:
nixos-rebuild build-vm -I nixos-config=./nix-cfg/configuration.nix && ./result/bin/run-glfos-vm
nixos-rebuild build-vm -I nixos-config=./iso-cfg/configuration.nix && ./result/bin/run-glfos-vm

# Update flake.lock
update:
Expand Down
File renamed without changes
File renamed without changes
24 changes: 21 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 41 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
{
inputs = { nixpkgs.url = "nixpkgs/nixos-24.11"; };
description = "GLF-OS";

outputs = { nixpkgs, ... } @ inputs:
let system = "x86_64-linux";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
};

outputs = { self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
in
rec
{
rec {

nixosModules = {
default = import ./modules/default;
};

iso = nixosConfigurations."glf-installer".config.system.build.isoImage;

nixosConfigurations = {
"glf-installer" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; inherit system;
"glf-installer" = nixpkgs.lib.nixosSystem rec {
specialArgs = {
inherit inputs;
pkgs = pkgs;
};
inherit system;

modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix"
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
./nix-cfg/configuration.nix
self.nixosModules.default
./iso-cfg/configuration.nix
{
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
(self: super: {
calamares-nixos-extensions = super.calamares-nixos-extensions.overrideAttrs (oldAttrs: {
postInstall = ''
cp ${./patches/calamares-nixos-extensions/modules/nixos/main.py} $out/lib/calamares/modules/nixos/main.py
cp -r ${./patches/calamares-nixos-extensions/config/settings.conf} $out/share/calamares/settings.conf
cp -r ${./patches/calamares-nixos-extensions/config/modules/packagechooser.conf} $out/share/calamares/modules/packagechooser.conf
cp -r ${./patches/calamares-nixos-extensions/branding/nixos/show.qml} $out/share/calamares/branding/nixos/show.qml
cp -r ${./patches/calamares-nixos-extensions/branding/nixos/white.png} $out/share/calamares/branding/nixos/white.png
cp -r ${./patches/calamares-nixos-extensions/branding/nixos/base.png} $out/share/calamares/branding/nixos/base.png
Expand All @@ -37,21 +52,23 @@
})
];
}
({ config, ... }: {
isoImage = {
# change default partition name (cannot exceed 32 bytes)
# volumeID = nixpkgs.lib.mkDefault "glfos${nixpkgs.lib.optionalString (config.isoImage.edition != "") "-${config.isoImage.edition}"}-${config.system.nixos.release}";
volumeID = nixpkgs.lib.mkDefault "glfos-${config.system.nixos.version}";

includeSystemBuildDependencies = false;
storeContents = [ config.system.build.toplevel ];
squashfsCompression = "zstd -Xcompression-level 22";
contents = [{
source = ./nix-cfg;
target = "/nix-cfg";
}];
};
})
(
{ config, ... }:
{
isoImage = {
volumeID = nixpkgs.lib.mkDefault "glfos-${config.system.nixos.version}";
includeSystemBuildDependencies = false;
storeContents = [ config.system.build.toplevel ];
squashfsCompression = "zstd -Xcompression-level 22";
contents = [
{
source = ./iso-cfg;
target = "/iso-cfg";
}
];
};
}
)
];
};
};
Expand Down
15 changes: 5 additions & 10 deletions nix-cfg/configuration.nix → iso-cfg/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# NE TOUCHEZ A RIEN
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{ config, pkgs, lib, ... }:

{
imports = [
./hardware-configuration.nix
./glf
];

i18n.defaultLocale = "fr_FR.UTF-8";

Expand All @@ -18,13 +12,14 @@
excludePackages = [ pkgs.xterm ];
};

users.users.test = {
users.users.nixos = {
isNormalUser = true;
description = "test";
extraGroups = [ "networkmanager" "wheel" "render" ];
};

nvidia_config.enable = true;
networking.hostName = "GLF-OS";

# nvidia_config.enable = true;

nix.settings.experimental-features = [ "nix-command" "flakes" ];

Expand Down
63 changes: 63 additions & 0 deletions iso-cfg/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions iso-cfg/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{

description = "GLF-OS";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
glf.url = "github:CORAAL/Nixos-by-GLF/coraal_flakeInit";
};

outputs = { self, nixpkgs, glf, ... }@inputs:
let
pkgsSettings = system: import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
nixosConfigurations."GLF-OS" = nixpkgs.lib.nixosSystem {
pkgs = pkgsSettings "x86_64-linux";
modules = [
./configuration.nix
inputs.glf.nixosModules.default
];
};
};

}
File renamed without changes.
22 changes: 22 additions & 0 deletions modules/default/boot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, config, pkgs, ... }:

{

options.glf.boot.enable = lib.mkOption {
description = "Enable GLF Boot configurations";
type = lib.types.bool;
default = true;
};

config = lib.mkIf config.glf.boot.enable {

boot = {
tmp.cleanOnBoot = true;
supportedFilesystems.zfs = lib.mkDefault false;
kernelPackages = lib.mkDefault pkgs.linuxPackages_zen;
kernelParams = if builtins.elem "kvm-amd" config.boot.kernelModules then [ "amd_pstate=active" ] else [ ];
};

};

}
18 changes: 10 additions & 8 deletions nix-cfg/glf/default.nix → modules/default/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{

imports = [
./version.nix
./nh.nix
./boot.nix
./gnome.nix
./fstrim.nix
./gaming.nix
./firefox.nix
./paquets.nix
./pipewire.nix
./nh.nix
./gnome.nix
./packages.nix
./gaming.nix
./printing.nix
./nvidia.nix
./pipewire.nix
./system.nix
./updateConf.nix
./imprimante.nix
# ./updateConf.nix
./version.nix
];

}
25 changes: 25 additions & 0 deletions modules/default/firefox.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ inputs, lib, config, pkgs, ... }:

{

options.glf.firefox.enable = lib.mkOption {
description = "Enable GLF firefox configurations";
type = lib.types.bool;
default = true;
};

config = lib.mkIf config.glf.firefox.enable {

programs.firefox = {
enable = true;
wrapperConfig.pipewireSupport = true;
languagePacks = [ "fr" "en-US" ];
preferences = {
"intl.accept_languages" = "fr-fr,en-us,en";
"intl.locale.requested" = "fr,en-US";
};
};

};

}
20 changes: 20 additions & 0 deletions modules/default/fstrim.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ lib, config, ... }:

{

options.glf.fstrim.enable = lib.mkOption {
description = "Enable GLF Fstrim configurations";
type = lib.types.bool;
default = true;
};

config = lib.mkIf config.glf.fstrim.enable {

services.fstrim = {
enable = true;
interval = "daily";
};

};

}
Loading

0 comments on commit ae8587c

Please sign in to comment.