forked from auxolotl/templates
Compare commits
22 commits
liketechni
...
main
Author | SHA1 | Date | |
---|---|---|---|
Dusty Pomerleau | d2b524bc50 | ||
sugar🍬🍭🏳️⚧️ | dcb9bc3396 | ||
Raphael Das Gupta | 3fda15c3f9 | ||
Samuel Shuert | 821048587f | ||
isabel roses | 6d9f867465 | ||
isabel roses | 03a8f01dfe | ||
Samuel Shuert | 76519a32df | ||
bcc0fbbfcc | |||
Samuel Shuert | a3ca38e31c | ||
Samuel Shuert | 84216867bd | ||
isabel roses | fdbefeff2a | ||
Samuel Shuert | cfd424d324 | ||
Samuel Shuert | e83ad899f6 | ||
isabel roses | 78374d6350 | ||
d981bc409e | |||
72b9616f87 | |||
57769ca9ed | |||
e2607d77cc | |||
a95b46a6a0 | |||
c1524d5bd9 | |||
30022cc914 | |||
aff83a7bf1 |
|
@ -3,7 +3,7 @@
|
|||
</p>
|
||||
|
||||
<p align="center">
|
||||
This is a template repository for getting started with your brand new FreshwaterOS system.
|
||||
This is a template repository for getting started with your brand new Auxolotl system.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
|
@ -22,7 +22,7 @@ There are 3 main templates in this repository:
|
|||
|
||||
#### With Darwin (macOS)
|
||||
|
||||
1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flake new -t github:auxolotl/templates#darwin NixFiles` in the terminal. This will setup the basic configuration for the system, this generate a configuration for you from the files located in the `darwin` directory.
|
||||
1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t git+https://git.auxolotl.org/auxolotl/templates#darwin NixFiles` in the terminal. This will setup the basic configuration for the system, this generate a configuration for you from the files located in the `darwin` directory.
|
||||
2. The next step is to go into the `NixFiles` directory this can be achieved by running `cd NixFiles`.
|
||||
3. Now we you need to read over the configuration files and make any changes that you see fit, some of these must include changing your username and hostname.
|
||||
4. You now must rebuild this configuration we can do this with `nix run darwin -- switch --flake .#hostname` hostname should be substituted for your systems hostname.
|
||||
|
@ -30,7 +30,7 @@ There are 3 main templates in this repository:
|
|||
|
||||
#### With NixOS
|
||||
|
||||
1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flake new -t github:auxolotl/templates#system NixFiles`
|
||||
1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t git+https://git.auxolotl.org/auxolotl/templates#system NixFiles`
|
||||
2. Move into your new system with `cd NixFiles`
|
||||
3. Fill in your `hostName` in `flake.nix`
|
||||
4. Run `nixos-generate-config --show-hardware-config > hardware-configuration.nix` to generate configuration based on your filesystems and drivers
|
||||
|
@ -40,6 +40,6 @@ Congratulations, you are now using Aux!
|
|||
|
||||
#### With Home-manager
|
||||
|
||||
1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flake new -t github:auxolotl/templates#home-manager NixFiles` to start
|
||||
1. Run `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake new -t git+https://git.auxolotl.org/auxolotl/templates#home-manager NixFiles` to start
|
||||
2. Move into your new Nix system with `cd NixFiles`
|
||||
3. Fill in your `username` in `flake.nix`
|
||||
|
|
22
c/.editorconfig
Normal file
22
c/.editorconfig
Normal file
|
@ -0,0 +1,22 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
max_line_length = 80
|
||||
tab_width = 4
|
||||
|
||||
[{Makefile,*.mk}]
|
||||
indent_style = tab
|
||||
|
||||
[*.nix]
|
||||
indent_style = space
|
||||
tab_width = 2
|
||||
indent_size = 2
|
||||
|
||||
[*.lock]
|
||||
indent_style = unset
|
||||
insert_final_newline = unset
|
64
c/.gitignore
vendored
Normal file
64
c/.gitignore
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
# binaries
|
||||
hello
|
||||
|
||||
# language support
|
||||
compile_commands.json
|
||||
.cache
|
||||
|
||||
# nix
|
||||
.direnv
|
||||
result*
|
||||
repl-result-*
|
||||
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.ilk
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
*.pdb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
30
c/Makefile
Normal file
30
c/Makefile
Normal file
|
@ -0,0 +1,30 @@
|
|||
CC ?= gcc
|
||||
CFLAGS += -pedantic -Wall -Wextra -O2
|
||||
|
||||
OUT := hello
|
||||
BINDIR ?= /usr/bin
|
||||
|
||||
SRC += main.c
|
||||
OBJ := $(SRC:.c=.o)
|
||||
|
||||
.PHONY: all
|
||||
all: $(OUT)
|
||||
|
||||
$(OUT): $(OBJ)
|
||||
$(CC) -o $@ $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) $(OBJ)
|
||||
|
||||
.PHONY: fclean
|
||||
fclean: clean
|
||||
$(RM) -r $(OUT)
|
||||
|
||||
.PHONY: re
|
||||
.NOTPARALLEL: re
|
||||
re: fclean all
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
install -D hello ${BINDIR}/hello --mode 0755
|
27
c/flake.nix
Normal file
27
c/flake.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
description = "Aux template for C project";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
let
|
||||
forAllSystems =
|
||||
function:
|
||||
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
|
||||
system: function nixpkgs.legacyPackages.${system}
|
||||
);
|
||||
in
|
||||
rec {
|
||||
devShells = forAllSystems (pkgs: {
|
||||
default = pkgs.mkShell { inputsFrom = [ packages.${pkgs.system}.hello ]; };
|
||||
});
|
||||
|
||||
packages = forAllSystems (pkgs: rec {
|
||||
default = hello;
|
||||
hello = pkgs.callPackage ./hello.nix { };
|
||||
});
|
||||
|
||||
overlays.default = final: prev: { hello = prev.callPackage ./default.nix { }; };
|
||||
};
|
||||
}
|
7
c/hello.nix
Normal file
7
c/hello.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ stdenv }:
|
||||
stdenv.mkDerivation {
|
||||
name = "hello";
|
||||
src = ./.;
|
||||
|
||||
env.BINDIR = "${placeholder "out"}/bin";
|
||||
}
|
11
c/main.c
Normal file
11
c/main.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char greet[] = "hello, world!\n";
|
||||
int written = printf("%s", greet);
|
||||
|
||||
return written == (sizeof(greet) - 1)
|
||||
? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
inputs = {
|
||||
# nixpkgs is the input that we use for this flake the end section `nixpkgs-unstable` refers to the branch
|
||||
# of nixpkgs that we want to use. This can be changed to any branch or commit hash.
|
||||
nixpkgs.url = "github:auxolotl/nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
|
@ -23,13 +23,7 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
darwin,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
inputs@{ darwin, home-manager, ... }:
|
||||
# we can use the `let` and `in` syntax to define variables
|
||||
# and use them in the rest of the expression
|
||||
let
|
||||
|
@ -82,7 +76,7 @@
|
|||
};
|
||||
};
|
||||
# Here we can create our user
|
||||
uses.users.${username} = {
|
||||
users.users.${username} = {
|
||||
home = "/Users/${username}";
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "An empty devshell with direnv support";
|
||||
|
||||
inputs.nixpkgs.url = "github:auxolotl/nixpkgs/nixpkgs-unstable";
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "Templates for getting started with Aux";
|
||||
|
||||
inputs.nixpkgs.url = "github:auxolotl/nixpkgs/nixpkgs-unstable";
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
description = "A simple home-manager flake using Aux";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:auxolotl/nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
|
|
|
@ -101,37 +101,27 @@
|
|||
];
|
||||
|
||||
nix = {
|
||||
registry.nixpkgs = {
|
||||
from = {
|
||||
id = "nixpkgs";
|
||||
type = "indirect";
|
||||
};
|
||||
to = {
|
||||
owner = "auxolotl";
|
||||
repo = "nixpkgs";
|
||||
type = "github";
|
||||
};
|
||||
};
|
||||
|
||||
gc.automatic = true;
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
};
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "A simple system flake using some Aux defaults";
|
||||
|
||||
inputs.nixpkgs.url = "github:auxolotl/nixpkgs/nixos-unstable";
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs =
|
||||
inputs@{ nixpkgs, ... }:
|
||||
|
@ -11,11 +11,13 @@
|
|||
in
|
||||
{
|
||||
nixosConfigurations.${hostName} = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
./configuration.nix
|
||||
|
||||
{ networking.hostName = hostName; }
|
||||
{
|
||||
networking.hostName = hostName;
|
||||
nixpkgs.hostPlatform = system;
|
||||
}
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
|
|
Loading…
Reference in a new issue